}
_injectTracking(methodName) {
- const { prototype } = Gio.DBusMethodInvocation;
+ const {prototype} = Gio.DBusMethodInvocation;
const origMethod = prototype[methodName];
const that = this;
const SCROLL_ANIMATION_TIME = 500;
const AuthListItem = GObject.registerClass({
- Signals: { 'activate': {} },
+ Signals: {'activate': {}},
}, class AuthListItem extends St.Button {
_init(key, text) {
this.key = key;
export const AuthList = GObject.registerClass({
Signals: {
- 'activate': { param_types: [GObject.TYPE_STRING] },
- 'item-added': { param_types: [AuthListItem.$gtype] },
+ 'activate': {param_types: [GObject.TYPE_STRING]},
+ 'item-added': {param_types: [AuthListItem.$gtype]},
},
}, class AuthList extends St.BoxLayout {
_init() {
y_align: Clutter.ActorAlign.CENTER,
});
- this.label = new St.Label({ style_class: 'login-dialog-auth-list-title' });
+ this.label = new St.Label({style_class: 'login-dialog-auth-list-title'});
this.add_child(this.label);
this._scrollView = new St.ScrollView({
'failed': {},
'next': {},
'prompted': {},
- 'reset': { param_types: [GObject.TYPE_UINT] },
+ 'reset': {param_types: [GObject.TYPE_UINT]},
},
}, class AuthPrompt extends St.BoxLayout {
_init(gdmClient, mode) {
else if (this._mode == AuthPromptMode.UNLOCK_OR_LOG_IN)
reauthenticationOnly = false;
- this._userVerifier = new GdmUtil.ShellUserVerifier(this._gdmClient, { reauthenticationOnly });
+ this._userVerifier = new GdmUtil.ShellUserVerifier(this._gdmClient, {reauthenticationOnly});
this._userVerifier.connect('ask-question', this._onAskQuestion.bind(this));
this._userVerifier.connect('show-message', this._onShowMessage.bind(this));
const _TIMED_LOGIN_IDLE_THRESHOLD = 5.0;
export const UserListItem = GObject.registerClass({
- Signals: { 'activate': {} },
+ Signals: {'activate': {}},
}, class UserListItem extends St.Button {
_init(user) {
let layout = new St.BoxLayout({
const UserList = GObject.registerClass({
Signals: {
- 'activate': { param_types: [UserListItem.$gtype] },
- 'item-added': { param_types: [UserListItem.$gtype] },
+ 'activate': {param_types: [UserListItem.$gtype]},
+ 'item-added': {param_types: [UserListItem.$gtype]},
},
}, class UserList extends St.ScrollView {
_init() {
});
const SessionMenuButton = GObject.registerClass({
- Signals: { 'session-activated': { param_types: [GObject.TYPE_STRING] } },
+ Signals: {'session-activated': {param_types: [GObject.TYPE_STRING]}},
}, class SessionMenuButton extends St.Bin {
_init() {
let button = new St.Button({
y_align: Clutter.ActorAlign.CENTER,
});
- super._init({ child: button });
+ super._init({child: button});
this._button = button;
this._menu = new PopupMenu.PopupMenu(this._button, 0, St.Side.BOTTOM);
});
this._manager = new PopupMenu.PopupMenuManager(this._button,
- { actionMode: Shell.ActionMode.NONE });
+ {actionMode: Shell.ActionMode.NONE});
this._manager.addMenu(this._menu);
this._button.connect('clicked', () => this._menu.toggle());
},
}, class LoginDialog extends St.Widget {
_init(parentActor) {
- super._init({ style_class: 'login-dialog', visible: false });
+ super._init({style_class: 'login-dialog', visible: false});
this.get_accessible().set_role(Atk.Role.WINDOW);
- this.add_constraint(new Layout.MonitorConstraint({ primary: true }));
+ this.add_constraint(new Layout.MonitorConstraint({primary: true}));
this.connect('destroy', this._onDestroy.bind(this));
parentActor.add_child(this);
} catch (e) {
}
- this._settings = new Gio.Settings({ schema_id: GdmUtil.LOGIN_SCREEN_SCHEMA });
+ this._settings = new Gio.Settings({schema_id: GdmUtil.LOGIN_SCREEN_SCHEMA});
this._settings.connect(`changed::${GdmUtil.BANNER_MESSAGE_KEY}`,
this._updateBanner.bind(this));
});
this.add_child(this._bannerView);
- let bannerBox = new St.BoxLayout({ vertical: true });
+ let bannerBox = new St.BoxLayout({vertical: true});
this._bannerView.add_actor(bannerBox);
this._bannerLabel = new St.Label({
if (previousUser && beginRequest === AuthPrompt.BeginRequestType.REUSE_USERNAME) {
this._user = previousUser;
this._authPrompt.setUser(this._user);
- this._authPrompt.begin({ userName: previousUser.get_user_name() });
+ this._authPrompt.begin({userName: previousUser.get_user_name()});
} else if (beginRequest === AuthPrompt.BeginRequestType.PROVIDE_USERNAME) {
if (!this._disableUserList)
this._showUserList();
let answer = this._authPrompt.getAnswer();
this._user = this._userManager.get_user(answer);
this._authPrompt.clear();
- this._authPrompt.begin({ userName: answer });
+ this._authPrompt.begin({userName: answer});
this._updateCancelButton();
});
this._updateCancelButton();
let userName = item.user.get_user_name();
let hold = new Batch.Hold();
- this._authPrompt.begin({ userName, hold });
+ this._authPrompt.begin({userName, hold});
return hold;
}
Main.ctrlAltTabManager.addGroup(this,
_('Login Window'),
'dialog-password-symbolic',
- { sortGroup: CtrlAltTab.SortGroup.MIDDLE });
+ {sortGroup: CtrlAltTab.SortGroup.MIDDLE});
this.activate();
this.opacity = 0;
- this._grab = Main.pushModal(global.stage, { actionMode: Shell.ActionMode.LOGIN_SCREEN });
+ this._grab = Main.pushModal(global.stage, {actionMode: Shell.ActionMode.LOGIN_SCREEN});
this.ease({
opacity: 255,
export class ShellUserVerifier extends Signals.EventEmitter {
constructor(client, params) {
super();
- params = Params.parse(params, { reauthenticationOnly: false });
+ params = Params.parse(params, {reauthenticationOnly: false});
this._reauthOnly = params.reauthenticationOnly;
this._client = client;
this._defaultService = null;
this._preemptingService = null;
- this._settings = new Gio.Settings({ schema_id: LOGIN_SCREEN_SCHEMA });
+ this._settings = new Gio.Settings({schema_id: LOGIN_SCREEN_SCHEMA});
this._settings.connect('changed',
this._updateDefaultService.bind(this));
this._updateDefaultService();
_queueMessage(serviceName, message, messageType) {
let interval = this._getIntervalForMessage(message);
- this._messageQueue.push({ serviceName, text: message, type: messageType, interval });
+ this._messageQueue.push({serviceName, text: message, type: messageType, interval});
this._queueMessageTimeout();
}
this._candidatePopup.setPanelService(this._panelService);
this._panelService.connect('update-property', this._updateProperty.bind(this));
this._panelService.connect('set-cursor-location', (ps, x, y, w, h) => {
- let cursorLocation = { x, y, width: w, height: h };
+ let cursorLocation = {x, y, width: w, height: h};
this.emit('set-cursor-location', cursorLocation);
});
this._panelService.connect('focus-in', (panel, path) => {
*/
export function findMatchingBrace(expr, offset) {
let closeBrace = expr.charAt(offset);
- let openBrace = { ')': '(', ']': '[' }[closeBrace];
+ let openBrace = {')': '(', ']': '['}[closeBrace];
return findTheBrace(expr, offset - 1, openBrace, closeBrace);
}
this._currentKeymap.options == options)
return;
- this._currentKeymap = { layouts, variants, options };
+ this._currentKeymap = {layouts, variants, options};
global.backend.set_keymap(layouts, variants, options);
}
for (let i = 0; i < ids.length; ++i) {
let [found, , , _layout, _variant] = this._xkbInfo.get_layout_info(ids[i]);
if (found)
- this._layoutInfos[ids[i]] = { id: ids[i], layout: _layout, variant: _variant };
+ this._layoutInfos[ids[i]] = {id: ids[i], layout: _layout, variant: _variant};
}
let i = 0;
let _layout, _variant;
[found, , , _layout, _variant] = this._xkbInfo.get_layout_info(id);
if (found)
- return { layout: _layout, variant: _variant };
+ return {layout: _layout, variant: _variant};
else
- return { layout: DEFAULT_LAYOUT, variant: DEFAULT_VARIANT };
+ return {layout: DEFAULT_LAYOUT, variant: DEFAULT_VARIANT};
}
_buildGroupStrings(_group) {
await this._proxy.call_with_unix_fd_list('Inhibit',
inVariant, 0, -1, null, cancellable);
const [fd] = fdList.steal_fds();
- return new Gio.UnixInputStream({ fd });
+ return new Gio.UnixInputStream({fd});
}
_prepareForSleep(proxy, sender, [aboutToSuspend]) {
},
}, class BroadbandModem extends ModemBase {
_init(path, capabilities) {
- super._init({ capabilities });
+ super._init({capabilities});
this._proxy = new BroadbandModemProxy(Gio.DBus.system, 'org.freedesktop.ModemManager1', path);
this._proxy_3gpp = new BroadbandModem3gppProxy(Gio.DBus.system, 'org.freedesktop.ModemManager1', path);
this._proxy_cdma = new BroadbandModemCdmaProxy(Gio.DBus.system, 'org.freedesktop.ModemManager1', path);
try {
const connection = await Gio.DBus.get(Gio.BusType.SYSTEM, null);
- this._manager = new Malcontent.Manager({ connection });
+ this._manager = new Malcontent.Manager({connection});
this._appFilter = await this._getAppFilter();
} catch (e) {
logError(e, 'Failed to get parental controls settings');
_getSignalData(obj) {
let data = this._map.get(obj);
if (data === undefined) {
- data = { ownerSignals: [], destroyId: 0 };
+ data = {ownerSignals: [], destroyId: 0};
this._map.set(obj, data);
}
return data;
* @returns {void}
*/
untrack(obj) {
- const { ownerSignals, destroyId } = this._getSignalData(obj);
+ const {ownerSignals, destroyId} = this._getSignalData(obj);
this._map.delete(obj);
const ownerProto = this._getObjectProto(this._owner);
let results = [];
- for (let [key, { available, keywords }] of this._actions) {
+ for (let [key, {available, keywords}] of this._actions) {
if (available && terms.every(t => keywords.some(k => k.startsWith(t))))
results.push(key);
}
export function findUrls(str) {
let res = [], match;
while ((match = _urlRegexp.exec(str)))
- res.push({ url: match[2], pos: match.index + match[1].length });
+ res.push({url: match[2], pos: match.index + match[1].length});
return res;
}
// We are only interested in the part in the parentheses. (And
// we can't pattern match the text, since it gets localized.)
let message = err.message.replace(/.*\((.+)\)/, '$1');
- throw new err.constructor({ code: err.code, message });
+ throw new err.constructor({code: err.code, message});
} else {
throw err;
}
*/
export function createTimeLabel(date, params) {
if (_desktopSettings == null)
- _desktopSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.interface' });
+ _desktopSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.interface'});
- let label = new St.Label({ text: formatTime(date, params) });
+ let label = new St.Label({text: formatTime(date, params)});
_desktopSettings.connectObject(
'changed::clock-format', () => (label.text = formatTime(date, params)),
label);
this._permStore.connectSignal('Changed',
this._onPermStoreChanged.bind(this));
- this._locationSettings = new Gio.Settings({ schema_id: 'org.gnome.system.location' });
+ this._locationSettings = new Gio.Settings({schema_id: 'org.gnome.system.location'});
this._locationSettings.connect('changed::enabled',
this._updateAutoLocation.bind(this));
const AccessDialog = GObject.registerClass(
class AccessDialog extends ModalDialog.ModalDialog {
_init(invocation, handle, title, description, body, options) {
- super._init({ styleClass: 'access-dialog' });
+ super._init({styleClass: 'access-dialog'});
this._invocation = invocation;
this._handle = handle;
let grantLabel = options['grant_label'] || _('Allow');
let choices = options['choices'] || [];
- let content = new Dialog.MessageDialogContent({ title, description });
+ let content = new Dialog.MessageDialogContent({title, description});
this.contentLayout.add_actor(content);
this._choices = new Map();
const CyclerHighlight = GObject.registerClass(
class CyclerHighlight extends St.Widget {
_init() {
- super._init({ layout_manager: new Clutter.BinLayout() });
+ super._init({layout_manager: new Clutter.BinLayout()});
this._window = null;
this._clone = new Clutter.Clone();
this.add_actor(this._clone);
- this._highlight = new St.Widget({ style_class: 'cycler-highlight' });
+ this._highlight = new St.Widget({style_class: 'cycler-highlight'});
this.add_actor(this._highlight);
let coordinate = Clutter.BindCoordinate.ALL;
- let constraint = new Clutter.BindConstraint({ coordinate });
+ let constraint = new Clutter.BindConstraint({coordinate});
this._clone.bind_property('source', constraint, 'source', 0);
this.add_constraint(constraint);
// expects instead of inheriting from SwitcherList
const CyclerList = GObject.registerClass({
Signals: {
- 'item-activated': { param_types: [GObject.TYPE_INT] },
- 'item-entered': { param_types: [GObject.TYPE_INT] },
- 'item-removed': { param_types: [GObject.TYPE_INT] },
- 'item-highlighted': { param_types: [GObject.TYPE_INT] },
+ 'item-activated': {param_types: [GObject.TYPE_INT]},
+ 'item-entered': {param_types: [GObject.TYPE_INT]},
+ 'item-removed': {param_types: [GObject.TYPE_INT]},
+ 'item-highlighted': {param_types: [GObject.TYPE_INT]},
},
}, class CyclerList extends St.Widget {
highlight(index, _justOutline) {
export const GroupCyclerPopup = GObject.registerClass(
class GroupCyclerPopup extends CyclerPopup {
_init() {
- this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell.app-switcher' });
+ this._settings = new Gio.Settings({schema_id: 'org.gnome.shell.app-switcher'});
super._init();
}
class WindowSwitcherPopup extends SwitcherPopup.SwitcherPopup {
_init() {
super._init();
- this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell.window-switcher' });
+ this._settings = new Gio.Settings({schema_id: 'org.gnome.shell.window-switcher'});
let windows = this._getWindowList();
export const WindowCyclerPopup = GObject.registerClass(
class WindowCyclerPopup extends CyclerPopup {
_init() {
- this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell.window-switcher' });
+ this._settings = new Gio.Settings({schema_id: 'org.gnome.shell.window-switcher'});
super._init();
}
this._arrows = [];
let windowTracker = Shell.WindowTracker.get_default();
- let settings = new Gio.Settings({ schema_id: 'org.gnome.shell.app-switcher' });
+ let settings = new Gio.Settings({schema_id: 'org.gnome.shell.app-switcher'});
let workspace = null;
if (settings.get_boolean('current-workspace-only')) {
this._removeIcon(app);
}, this);
- let arrow = new St.DrawingArea({ style_class: 'switcher-arrow' });
+ let arrow = new St.DrawingArea({style_class: 'switcher-arrow'});
arrow.connect('repaint', () => SwitcherPopup.drawArrow(arrow, St.Side.BOTTOM));
this.add_actor(arrow);
this._arrows.push(arrow);
vertical: true,
});
- let bin = new St.Bin({ style_class: 'thumbnail' });
+ let bin = new St.Bin({style_class: 'thumbnail'});
box.add_actor(bin);
this._thumbnailBins.push(bin);
this.window = window;
- this._icon = new St.Widget({ layout_manager: new Clutter.BinLayout() });
+ this._icon = new St.Widget({layout_manager: new Clutter.BinLayout()});
this.add_child(this._icon);
- this.label = new St.Label({ text: window.get_title() });
+ this.label = new St.Label({text: window.get_title()});
let tracker = Shell.WindowTracker.get_default();
this.app = tracker.get_window_app(window);
_createAppIcon(app, size) {
let appIcon = app
? app.create_icon_texture(size)
- : new St.Icon({ icon_name: 'icon-missing', icon_size: size });
+ : new St.Icon({icon_name: 'icon-missing', icon_size: size});
appIcon.x_expand = appIcon.y_expand = true;
appIcon.x_align = appIcon.y_align = Clutter.ActorAlign.END;
adjustment.remove_transition('value');
const progress = adjustment.value / adjustment.page_size;
- const points = Array.from({ length: this._grid.nPages }, (v, i) => i);
+ const points = Array.from({length: this._grid.nPages}, (v, i) => i);
const size = tracker.orientation === Clutter.Orientation.VERTICAL
? this._grid.allocation.get_height() : this._grid.allocation.get_width();
if (!success)
return;
- const { source } = dragEvent;
+ const {source} = dragEvent;
const [page, position, dragLocation] =
this._getDropTarget(x, y, source);
const item = position !== -1
if (!this._delayedMoveData)
return;
- const { source, destroyId, timeoutId } = this._delayedMoveData;
+ const {source, destroyId, timeoutId} = this._delayedMoveData;
if (timeoutId > 0)
GLib.source_remove(timeoutId);
if (dropTarget === this._prevPageIndicator ||
dropTarget === this._nextPageIndicator) {
const increment = dropTarget === this._prevPageIndicator ? -1 : 1;
- const { currentPage, nPages } = this._grid;
+ const {currentPage, nPages} = this._grid;
const page = Math.min(currentPage + increment, nPages);
const position = page < nPages ? -1 : 0;
this.goToPage(page);
} else if (this._delayedMoveData) {
// Dropped before the icon was moved
- const { page, position } = this._delayedMoveData;
+ const {page, position} = this._delayedMoveData;
this._moveItem(source, page, position);
this._removeDelayedMove();
}
_getItemPosition(item) {
- const { itemsPerPage } = this._grid;
+ const {itemsPerPage} = this._grid;
let iconIndex = this._orderedItems.indexOf(item);
if (iconIndex === -1)
});
const PageManager = GObject.registerClass({
- Signals: { 'layout-changed': {} },
+ Signals: {'layout-changed': {}},
}, class PageManager extends GObject.Object {
_init() {
super._init();
Shell.AppSystem.get_default().connect('installed-changed', () => {
Main.queueDeferredWork(this._redisplayWorkId);
});
- this._folderSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.app-folders' });
+ this._folderSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.app-folders'});
this._ensureDefaultFolders();
this._folderSettings.connect('changed::folder-children', () => {
Main.queueDeferredWork(this._redisplayWorkId);
const folders = Object.keys(DEFAULT_FOLDERS);
this._folderSettings.set_strv('folder-children', folders);
- const { path } = this._folderSettings;
+ const {path} = this._folderSettings;
for (const folder of folders) {
- const { name, categories, apps } = DEFAULT_FOLDERS[folder];
+ const {name, categories, apps} = DEFAULT_FOLDERS[folder];
const child = new Gio.Settings({
schema_id: 'org.gnome.desktop.app-folders.folder',
path: `${path}folders/${folder}/`,
global.settings.is_writable('favorite-apps') ||
global.settings.is_writable('app-picker-layout');
- this._placeholder = new AppIcon(app, { isDraggable });
+ this._placeholder = new AppIcon(app, {isDraggable});
this._placeholder.connect('notify::pressed', icon => {
if (icon.pressed)
this.updateDragFocus(icon);
if (!icon) {
let app = appSys.lookup_app(appId);
- icon = new AppIcon(app, { isDraggable });
+ icon = new AppIcon(app, {isDraggable});
icon.connect('notify::pressed', () => {
if (icon.pressed)
this.updateDragFocus(icon);
}
getResultMetas(apps) {
- const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage);
+ const {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
let metas = [];
for (let id of apps) {
if (id.endsWith('.desktop')) {
style_class: 'system-action-icon',
});
- metas.push({ id, name, createIcon });
+ metas.push({id, name, createIcon});
}
}
class AppViewItem extends St.Button {
_init(params = {}, isDraggable = true, expandTitleOnHover = true) {
super._init({
- pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }),
+ pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
reactive: true,
button_mask: St.ButtonMask.ONE | St.ButtonMask.TWO,
can_focus: true,
this._delegate = this;
if (isDraggable) {
- this._draggable = DND.makeDraggable(this, { timeoutThreshold: 200 });
+ this._draggable = DND.makeDraggable(this, {timeoutThreshold: 200});
this._draggable.connect('drag-begin', this._onDragBegin.bind(this));
this._draggable.connect('drag-cancelled', this._onDragCancelled.bind(this));
if (!this._expandTitleOnHover || !this.icon.label)
return;
- const { label } = this.icon;
- const { clutterText } = label;
+ const {label} = this.icon;
+ const {clutterText} = label;
const layout = clutterText.get_layout();
if (!layout.is_wrapped() && !layout.is_ellipsized())
return;
let rtl = icon.get_text_direction() == Clutter.TextDirection.RTL;
for (let i = 0; i < 4; i++) {
const style = `width: ${subSize}px; height: ${subSize}px;`;
- let bin = new St.Bin({ style });
+ let bin = new St.Bin({style});
if (i < numItems)
bin.child = this._orderedItems[i].app.create_icon_texture(subSize);
layout.attach(bin, rtl ? (i + 1) % 2 : i % 2, Math.floor(i / 2), 1, 1);
for (const key of keys)
this._folder.reset(key);
- let settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.app-folders' });
+ let settings = new Gio.Settings({schema_id: 'org.gnome.desktop.app-folders'});
let folders = settings.get_strv('folder-children');
folders.splice(folders.indexOf(this._id), 1);
settings.set_strv('folder-children', folders);
export const AppFolderDialog = GObject.registerClass({
Signals: {
- 'open-state-changed': { param_types: [GObject.TYPE_BOOLEAN] },
+ 'open-state-changed': {param_types: [GObject.TYPE_BOOLEAN]},
},
}, class AppFolderDialog extends St.Bin {
_init(source, folder, appDisplay) {
reactive: true,
});
- this.add_constraint(new Layout.MonitorConstraint({ primary: true }));
+ this.add_constraint(new Layout.MonitorConstraint({primary: true}));
const clickAction = new Clutter.ClickAction();
clickAction.connect('clicked', () => {
_onDestroy() {
if (this._isOpen) {
this._isOpen = false;
- this._grabHelper.ungrab({ actor: this });
+ this._grabHelper.ungrab({actor: this});
this._grabHelper = null;
}
_withinDialog(x, y) {
const childExtents = this.child.get_transformed_extents();
- return childExtents.contains_point(new Graphene.Point({ x, y }));
+ return childExtents.contains_point(new Graphene.Point({x, y}));
}
_setupDragMonitor() {
this._showFolderLabel();
this._isOpen = false;
- this._grabHelper.ungrab({ actor: this });
+ this._grabHelper.ungrab({actor: this});
this.emit('open-state-changed', false);
}
});
export const AppIcon = GObject.registerClass({
Signals: {
- 'menu-state-changed': { param_types: [GObject.TYPE_BOOLEAN] },
+ 'menu-state-changed': {param_types: [GObject.TYPE_BOOLEAN]},
'sync-tooltip': {},
},
}, class AppIcon extends AppViewItem {
_init(app, iconParams = {}) {
// Get the isDraggable property without passing it on to the BaseIcon:
- const appIconParams = Params.parse(iconParams, { isDraggable: true }, true);
+ const appIconParams = Params.parse(iconParams, {isDraggable: true}, true);
const isDraggable = appIconParams['isDraggable'];
delete iconParams['isDraggable'];
const expandTitleOnHover = appIconParams['expandTitleOnHover'];
delete iconParams['expandTitleOnHover'];
- super._init({ style_class: 'app-well-app' }, isDraggable, expandTitleOnHover);
+ super._init({style_class: 'app-well-app'}, isDraggable, expandTitleOnHover);
this.app = app;
this._id = app.get_id();
}
shellWorkspaceLaunch(params) {
- let { stack } = new Error();
+ let {stack} = new Error();
log(`shellWorkspaceLaunch is deprecated, use app.open_new_window() instead\n${stack}`);
params = Params.parse(params, {
if (!canFavorite)
return;
- const { id } = this._app;
+ const {id} = this._app;
this._toggleFavoriteItem.label.text = this._appFavorites.isFavorite(id)
? _('Unpin')
: _('Pin to Dash');
const AudioDeviceSelectionIface = loadInterfaceXML('org.gnome.Shell.AudioDeviceSelection');
const AudioDeviceSelectionDialog = GObject.registerClass({
- Signals: { 'device-selected': { param_types: [GObject.TYPE_UINT] } },
+ Signals: {'device-selected': {param_types: [GObject.TYPE_UINT]}},
}, class AudioDeviceSelectionDialog extends ModalDialog.ModalDialog {
_init(devices) {
- super._init({ styleClass: 'audio-device-selection-dialog' });
+ super._init({styleClass: 'audio-device-selection-dialog'});
this._deviceItems = {};
return;
}
- animation = new Animation({ file: params.file });
+ animation = new Animation({file: params.file});
animation.load_async(null, () => {
this._animations[params.settingsSchema] = animation;
}
const Background = GObject.registerClass({
- Signals: { 'loaded': {}, 'bg-changed': {} },
+ Signals: {'loaded': {}, 'bg-changed': {}},
}, class Background extends Meta.Background {
_init(params) {
params = Params.parse(params, {
style: null,
});
- super._init({ meta_display: global.display });
+ super._init({meta_display: global.display});
this._settings = params.settings;
this._file = params.file;
this._cancellable = new Gio.Cancellable();
this.isLoaded = false;
- this._interfaceSettings = new Gio.Settings({ schema_id: INTERFACE_SCHEMA });
+ this._interfaceSettings = new Gio.Settings({schema_id: INTERFACE_SCHEMA});
this._clock = new GnomeDesktop.WallClock();
this._clock.connectObject('notify::timezone',
let _systemBackground;
export const SystemBackground = GObject.registerClass({
- Signals: { 'loaded': {} },
+ Signals: {'loaded': {}},
}, class SystemBackground extends Meta.BackgroundActor {
_init() {
if (_systemBackground == null) {
- _systemBackground = new Meta.Background({ meta_display: global.display });
+ _systemBackground = new Meta.Background({meta_display: global.display});
_systemBackground.set_color(DEFAULT_BACKGROUND_COLOR);
}
// Allow override the background image setting for performance testing
this._layoutManager = layoutManager;
this._overrideImage = GLib.getenv('SHELL_BACKGROUND_IMAGE');
- this._settings = new Gio.Settings({ schema_id: settingsSchema });
+ this._settings = new Gio.Settings({schema_id: settingsSchema});
this._backgrounds = [];
const monitorManager = global.backend.get_monitor_manager();
monitorManager.connect('monitors-changed',
this._onMonitorsChanged.bind(this));
- this._interfaceSettings = new Gio.Settings({ schema_id: INTERFACE_SCHEMA });
+ this._interfaceSettings = new Gio.Settings({schema_id: INTERFACE_SCHEMA});
}
_onMonitorsChanged() {
this._newBackgroundActor = newBackgroundActor;
- const { background } = newBackgroundActor.content;
+ const {background} = newBackgroundActor.content;
if (background.isLoaded) {
this._swapBackgroundActor();
*
*/
export const BoxPointer = GObject.registerClass({
- Signals: { 'arrow-side-changed': {} },
+ Signals: {'arrow-side-changed': {}},
}, class BoxPointer extends St.Widget {
/**
* @param {*} arrowSide side to draw the arrow on
GObject.ParamFlags.READABLE,
false),
},
- Signals: { 'changed': {} },
+ Signals: {'changed': {}},
}, class EventSourceBase extends GObject.Object {
/**
* @returns {boolean}
let dayBegin = _getBeginningOfDay(day);
let dayEnd = _getEndOfDay(day);
- const { done } = this._getFilteredEvents(dayBegin, dayEnd).next();
+ const {done} = this._getFilteredEvents(dayBegin, dayEnd).next();
return !done;
}
});
export const Calendar = GObject.registerClass({
- Signals: { 'selected-date-changed': { param_types: [GLib.DateTime.$gtype] } },
+ Signals: {'selected-date-changed': {param_types: [GLib.DateTime.$gtype]}},
}, class Calendar extends St.Widget {
_init() {
this._weekStart = Shell.util_get_week_start();
- this._settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.calendar' });
+ this._settings = new Gio.Settings({schema_id: 'org.gnome.desktop.calendar'});
this._settings.connect(`changed::${SHOW_WEEKDATE_KEY}`, this._onSettingsChange.bind(this));
this._useWeekdate = this._settings.get_boolean(SHOW_WEEKDATE_KEY);
this.destroy_all_children();
// Top line of the calendar '<| September 2009 |>'
- this._topBox = new St.BoxLayout({ style_class: 'calendar-month-header' });
+ this._topBox = new St.BoxLayout({style_class: 'calendar-month-header'});
layout.attach(this._topBox, 0, 0, offsetCols + 7, 1);
this._backButton = new St.Button({
const Placeholder = GObject.registerClass(
class Placeholder extends St.BoxLayout {
_init() {
- super._init({ style_class: 'message-list-placeholder', vertical: true });
+ super._init({style_class: 'message-list-placeholder', vertical: true});
this._date = new Date();
- this._icon = new St.Icon({ icon_name: 'no-notifications-symbolic' });
+ this._icon = new St.Icon({icon_name: 'no-notifications-symbolic'});
this.add_actor(this._icon);
- this._label = new St.Label({ text: _('No Notifications') });
+ this._label = new St.Label({text: _('No Notifications')});
this.add_actor(this._label);
}
});
this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
box.add_actor(this._scrollView);
- let hbox = new St.BoxLayout({ style_class: 'message-list-controls' });
+ let hbox = new St.BoxLayout({style_class: 'message-list-controls'});
box.add_child(hbox);
const dndLabel = new St.Label({
});
this.set_accessible_role(Atk.Role.CHECK_BOX);
- this._box = new St.Bin({ y_align: Clutter.ActorAlign.START });
+ this._box = new St.Bin({y_align: Clutter.ActorAlign.START});
container.add_actor(this._box);
- this._label = new St.Label({ y_align: Clutter.ActorAlign.CENTER });
+ this._label = new St.Label({y_align: Clutter.ActorAlign.CENTER});
this._label.clutter_text.set_line_wrap(true);
this._label.clutter_text.set_ellipsize(Pango.EllipsizeMode.NONE);
this.set_label_actor(this._label);
let title = _('“%s” is not responding.').format(windowApp.get_name());
let description = _('You may choose to wait a short while for it to ' +
'continue or force the app to quit entirely.');
- return new Dialog.MessageDialogContent({ title, description });
+ return new Dialog.MessageDialogContent({title, description});
}
_updateScale() {
if (this._window.get_client_type() !== Meta.WindowClientType.WAYLAND)
return;
- let { scaleFactor } = St.ThemeContext.get_for_stage(global.stage);
+ let {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
this._dialog.set_scale(1 / scaleFactor, 1 / scaleFactor);
}
if (shouldTrack) {
Main.layoutManager.trackChrome(this._dialog,
- { affectsInputRegion: true });
+ {affectsInputRegion: true});
} else {
Main.layoutManager.untrackChrome(this._dialog);
}
class AutomountManager {
constructor() {
- this._settings = new Gio.Settings({ schema_id: SETTINGS_SCHEMA });
+ this._settings = new Gio.Settings({schema_id: SETTINGS_SCHEMA});
this._activeOperations = new Map();
this._session = new GnomeSession.SessionManager();
this._session.connectSignal('InhibitorAdded',
const existingDialog = prevOperation?.borrowDialog();
let operation =
new ShellMountOperation.ShellMountOperation(volume,
- { existingDialog });
+ {existingDialog});
this._mountVolume(volume, operation);
}
class ContentTypeDiscoverer {
constructor() {
- this._settings = new Gio.Settings({ schema_id: SETTINGS_SCHEMA });
+ this._settings = new Gio.Settings({schema_id: SETTINGS_SCHEMA});
}
async guessContentTypes(mount) {
constructor(manager) {
this._manager = manager;
this._sources = [];
- this._settings = new Gio.Settings({ schema_id: SETTINGS_SCHEMA });
+ this._settings = new Gio.Settings({schema_id: SETTINGS_SCHEMA});
}
_getAutorunSettingForType(contentType) {
const KeyringDialog = GObject.registerClass(
class KeyringDialog extends ModalDialog.ModalDialog {
_init() {
- super._init({ styleClass: 'prompt-dialog' });
+ super._init({styleClass: 'prompt-dialog'});
this.prompt = new Shell.KeyringPrompt();
this.prompt.connect('show-password', this._onShowPassword.bind(this));
this.prompt.set_password_actor(this._passwordEntry.clutter_text);
this.prompt.set_confirm_actor(this._confirmEntry.clutter_text);
- let warningBox = new St.BoxLayout({ vertical: true });
+ let warningBox = new St.BoxLayout({vertical: true});
let capsLockWarning = new ShellEntry.CapsLockWarning();
let syncCapsLockWarningVisibility = () => {
this.prompt.connect('notify::confirm-visible', syncCapsLockWarningVisibility);
warningBox.add_child(capsLockWarning);
- let warning = new St.Label({ style_class: 'prompt-dialog-error-label' });
+ let warning = new St.Label({style_class: 'prompt-dialog-error-label'});
warning.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
warning.clutter_text.line_wrap = true;
this.prompt.bind_property('warning',
const NetworkSecretDialog = GObject.registerClass(
class NetworkSecretDialog extends ModalDialog.ModalDialog {
_init(agent, requestId, connection, settingName, hints, flags, contentOverride) {
- super._init({ styleClass: 'prompt-dialog' });
+ super._init({styleClass: 'prompt-dialog'});
this._agent = agent;
this._requestId = requestId;
});
this._childPid = pid;
- this._stdin = new Gio.UnixOutputStream({ fd: stdin, close_fd: true });
- this._stdout = new Gio.UnixInputStream({ fd: stdout, close_fd: true });
+ this._stdin = new Gio.UnixOutputStream({fd: stdin, close_fd: true});
+ this._stdout = new Gio.UnixInputStream({fd: stdout, close_fd: true});
GLib.close(stderr);
- this._dataStdout = new Gio.DataInputStream({ base_stream: this._stdout });
+ this._dataStdout = new Gio.DataInputStream({base_stream: this._stdout});
if (this._newStylePlugin)
this._readStdoutNewStyle();
const DELAYED_RESET_TIMEOUT = 200;
const AuthenticationDialog = GObject.registerClass({
- Signals: { 'done': { param_types: [GObject.TYPE_BOOLEAN] } },
+ Signals: {'done': {param_types: [GObject.TYPE_BOOLEAN]}},
}, class AuthenticationDialog extends ModalDialog.ModalDialog {
_init(actionId, description, cookie, userNames) {
- super._init({ styleClass: 'prompt-dialog' });
+ super._init({styleClass: 'prompt-dialog'});
this.actionId = actionId;
this.message = description;
let title = _('Authentication Required');
- let headerContent = new Dialog.MessageDialogContent({ title, description });
+ let headerContent = new Dialog.MessageDialogContent({title, description});
this.contentLayout.add_child(headerContent);
let bodyContent = new Dialog.MessageDialogContent();
GObject.BindingFlags.SYNC_CREATE);
passwordBox.add_child(this._passwordEntry);
- let warningBox = new St.BoxLayout({ vertical: true });
+ let warningBox = new St.BoxLayout({vertical: true});
let capsLockWarning = new ShellEntry.CapsLockWarning();
this._passwordEntry.bind_property('visible',
* infoMessage and errorMessageLabel - but it is still invisible because
* gnome-shell.css sets the color to be transparent
*/
- this._nullMessageLabel = new St.Label({ style_class: 'prompt-dialog-null-label' });
+ this._nullMessageLabel = new St.Label({style_class: 'prompt-dialog-null-label'});
this._nullMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._nullMessageLabel.clutter_text.line_wrap = true;
warningBox.add_child(this._nullMessageLabel);
getIcon() {
let file = this._contact.get_avatar_file();
if (file)
- return new Gio.FileIcon({ file });
+ return new Gio.FileIcon({file});
else
- return new Gio.ThemedIcon({ name: 'avatar-default' });
+ return new Gio.ThemedIcon({name: 'avatar-default'});
}
getSecondaryIcon() {
default:
iconName = 'user-offline';
}
- return new Gio.ThemedIcon({ name: iconName });
+ return new Gio.ThemedIcon({name: iconName});
}
_updateAvatarIcon() {
if (this._notification) {
this._notification.update(this._notification.title,
this._notification.bannerBodyText,
- { gicon: this.getIcon() });
+ {gicon: this.getIcon()});
}
}
if (this._notification) {
this._notification.update(this._notification.title,
this._notification.bannerBodyText,
- { secondaryGIcon: this.getSecondaryIcon() });
+ {secondaryGIcon: this.getSecondaryIcon()});
}
}
const ChatNotification = HAVE_TP ? GObject.registerClass({
Signals: {
- 'message-removed': { param_types: [ChatNotificationMessage.$gtype] },
- 'message-added': { param_types: [ChatNotificationMessage.$gtype] },
- 'timestamp-changed': { param_types: [ChatNotificationMessage.$gtype] },
+ 'message-removed': {param_types: [ChatNotificationMessage.$gtype]},
+ 'message-added': {param_types: [ChatNotificationMessage.$gtype]},
+ 'timestamp-changed': {param_types: [ChatNotificationMessage.$gtype]},
},
}, class ChatNotification extends MessageTray.Notification {
_init(source) {
super._init(source, source.title, null,
- { secondaryGIcon: source.getSecondaryIcon() });
+ {secondaryGIcon: source.getSecondaryIcon()});
this.setUrgency(MessageTray.Urgency.HIGH);
this.setResident(true);
timestamp: currentTime,
noTimestamp: false,
});
- const { noTimestamp } = props;
+ const {noTimestamp} = props;
delete props.noTimestamp;
// Reset the old message timeout
this._oldMaxScrollValue = Math.max(adjustment.lower, adjustment.upper - adjustment.page_size);
});
- this._inputHistory = new History.HistoryManager({ entry: this._responseEntry.clutter_text });
+ this._inputHistory = new History.HistoryManager({entry: this._responseEntry.clutter_text});
this._composingTimeoutId = 0;
_init() {
super._init({
style_class: 'dash-item-container',
- pivot_point: new Graphene.Point({ x: .5, y: .5 }),
+ pivot_point: new Graphene.Point({x: .5, y: .5}),
layout_manager: new Clutter.BinLayout(),
scale_x: 0,
scale_y: 0,
});
this._labelText = '';
- this.label = new St.Label({ style_class: 'dash-label' });
+ this.label = new St.Label({style_class: 'dash-label'});
this.label.hide();
Main.layoutManager.addChrome(this.label);
this.label.connectObject('destroy', () => (this.label = null), this);
class DragPlaceholderItem extends DashItemContainer {
_init() {
super._init();
- this.setChild(new St.Bin({ style_class: 'placeholder' }));
+ this.setChild(new St.Bin({style_class: 'placeholder'}));
}
});
class EmptyDropTargetItem extends DashItemContainer {
_init() {
super._init();
- this.setChild(new St.Bin({ style_class: 'empty-dash-drop-target' }));
+ this.setChild(new St.Bin({style_class: 'empty-dash-drop-target'}));
}
});
const baseIconSizes = [16, 22, 24, 32, 48, 64];
export const Dash = GObject.registerClass({
- Signals: { 'icon-size-changed': {} },
+ Signals: {'icon-size-changed': {}},
}, class Dash extends St.Widget {
_init() {
this._maxWidth = -1;
this._dialog.add_child(this.contentLayout);
this.buttonLayout = new St.Widget({
- layout_manager: new Clutter.BoxLayout({ homogeneous: true }),
+ layout_manager: new Clutter.BoxLayout({homogeneous: true}),
});
this._dialog.add_child(this.buttonLayout);
}
if (!buttonInfo)
return Clutter.EVENT_PROPAGATE;
- let { button, action } = buttonInfo;
+ let {button, action} = buttonInfo;
if (action && button.reactive) {
action();
}
addButton(buttonInfo) {
- let { label, action, key } = buttonInfo;
+ let {label, action, key} = buttonInfo;
let isDefault = buttonInfo['default'];
let keys;
},
}, class MessageDialogContent extends St.BoxLayout {
_init(params) {
- this._title = new St.Label({ style_class: 'message-dialog-title' });
- this._description = new St.Label({ style_class: 'message-dialog-description' });
+ this._title = new St.Label({style_class: 'message-dialog-title'});
+ this._description = new St.Label({style_class: 'message-dialog-description'});
this._description.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._description.clutter_text.line_wrap = true;
},
}, class ListSection extends St.BoxLayout {
_init(params) {
- this._title = new St.Label({ style_class: 'dialog-list-title' });
+ this._title = new St.Label({style_class: 'dialog-list-title'});
this._listScrollView = new St.ScrollView({
style_class: 'dialog-list-scrollview',
y_align: Clutter.ActorAlign.CENTER,
});
- this._title = new St.Label({ style_class: 'dialog-list-item-title' });
+ this._title = new St.Label({style_class: 'dialog-list-item-title'});
this._description = new St.Label({
style_class: 'dialog-list-item-title-description',
textLayout.add_child(this._title);
textLayout.add_child(this._description);
- let defaultParams = { style_class: 'dialog-list-item' };
+ let defaultParams = {style_class: 'dialog-list-item'};
super._init(Object.assign(defaultParams, params));
this.label_actor = this._title;
function _getEventHandlerActor() {
if (!eventHandlerActor) {
- eventHandlerActor = new Clutter.Actor({ width: 0, height: 0, reactive: true });
+ eventHandlerActor = new Clutter.Actor({width: 0, height: 0, reactive: true});
Main.uiGroup.add_actor(eventHandlerActor);
// We connect to 'event' rather than 'captured-event' because the capturing phase doesn't happen
// when you've grabbed the pointer.
export const EdgeDragAction = GObject.registerClass({
Signals: {
'activated': {},
- 'progress': { param_types: [GObject.TYPE_DOUBLE] },
+ 'progress': {param_types: [GObject.TYPE_DOUBLE]},
},
}, class EdgeDragAction extends Clutter.GestureAction {
_init(side, allowedModes) {
}
_getMonitorRect(x, y) {
- let rect = new Meta.Rectangle({ x: x - 1, y: y - 1, width: 1, height: 1 });
+ let rect = new Meta.Rectangle({x: x - 1, y: y - 1, width: 1, height: 1});
let monitorIndex = global.display.get_monitor_index_for_rect(rect);
return global.display.get_monitor_geometry(monitorIndex);
// Use a different description when we are installing a system upgrade
// if the PackageKit proxy is available (i.e. PackageKit is available).
if (dialogContent.upgradeDescription) {
- const { name, version } = this._updateInfo.PreparedUpgrade;
+ const {name, version} = this._updateInfo.PreparedUpgrade;
if (name != null && version != null)
description = dialogContent.upgradeDescription(name, version);
}
.map(p => actor.get_transition(p))
.filter(t => t !== null);
- transitions.forEach(t => t.set({ repeatCount, autoReverse }));
+ transitions.forEach(t => t.set({repeatCount, autoReverse}));
const [transition] = transitions;
let pspec = actor.find_property(propName);
let transition = new Clutter.PropertyTransition(Object.assign({
property_name: propName,
- interval: new Clutter.Interval({ value_type: pspec.value_type }),
+ interval: new Clutter.Interval({value_type: pspec.value_type}),
remove_on_complete: true,
repeat_count: repeatCount,
auto_reverse: autoReverse,
* @throws
*/
function checkResponse(message) {
- const { statusCode } = message;
+ const {statusCode} = message;
const phrase = Soup.Status.get_phrase(statusCode);
if (statusCode !== Soup.Status.OK)
throw new Error(`Unexpected response: ${phrase}`);
const dir = Gio.File.new_for_path(
GLib.build_filenamev([global.userdatadir, 'extension-updates', uuid]));
- const params = { shell_version: Config.PACKAGE_VERSION };
+ const params = {shell_version: Config.PACKAGE_VERSION};
const message = Soup.Message.new_from_encoded_form('GET',
REPOSITORY_URL_DOWNLOAD.format(uuid),
Soup.form_encode_hash(params));
const InstallExtensionDialog = GObject.registerClass(
class InstallExtensionDialog extends ModalDialog.ModalDialog {
_init(uuid, info, invocation) {
- super._init({ styleClass: 'extension-dialog' });
+ super._init({styleClass: 'extension-dialog'});
this._uuid = uuid;
this._info = info;
async _onInstallButtonPressed() {
this.close();
- const params = { shell_version: Config.PACKAGE_VERSION };
+ const params = {shell_version: Config.PACKAGE_VERSION};
const message = Soup.Message.new_from_encoded_form('GET',
REPOSITORY_URL_DOWNLOAD.format(this._uuid),
Soup.form_encode_hash(params));
}
async unloadExtension(extension) {
- const { uuid, type } = extension;
+ const {uuid, type} = extension;
// Try to disable it -- if it's ERROR'd, we can't guarantee that,
// but it will be removed on next reboot, and hopefully nothing
async reloadExtension(oldExtension) {
// Grab the things we'll need to pass to createExtensionObject
// to reload it.
- let { uuid, dir, type } = oldExtension;
+ let {uuid, dir, type} = oldExtension;
// Then unload the old extension.
await this.unloadExtension(oldExtension);
if (type == Clutter.EventType.KEY_PRESS &&
event.get_key_symbol() == Clutter.KEY_Escape) {
- this.ungrab({ isUser: true });
+ this.ungrab({isUser: true});
return Clutter.EVENT_STOP;
}
this._ignoreUntilRelease = true;
let i = this._actorInGrabStack(targetActor) + 1;
- this.ungrab({ actor: this._grabStack[i].actor, isUser: true });
+ this.ungrab({actor: this._grabStack[i].actor, isUser: true});
return Clutter.EVENT_STOP;
}
reactive: true,
track_hover: true,
});
- box._indexLabel = new St.Label({ style_class: 'candidate-index' });
- box._candidateLabel = new St.Label({ style_class: 'candidate-label' });
+ box._indexLabel = new St.Label({style_class: 'candidate-index'});
+ box._candidateLabel = new St.Label({style_class: 'candidate-label'});
box.add_child(box._indexLabel);
box.add_child(box._candidateLabel);
this._candidateBoxes.push(box);
});
}
- this._buttonBox = new St.BoxLayout({ style_class: 'candidate-page-button-box' });
+ this._buttonBox = new St.BoxLayout({style_class: 'candidate-page-button-box'});
this._previousButton = new St.Button({
style_class: 'candidate-page-button candidate-page-button-previous button',
this.visible = false;
this.style_class = 'candidate-popup-boxpointer';
- this._dummyCursor = new Clutter.Actor({ opacity: 0 });
+ this._dummyCursor = new Clutter.Actor({opacity: 0});
Main.layoutManager.uiGroup.add_actor(this._dummyCursor);
Main.layoutManager.addTopChrome(this);
// so don't raise to the top.
// The on-screen keyboard is expected to be above any entries,
// so just above the keyboard gets us to the right layer.
- const { keyboardBox } = Main.layoutManager;
+ const {keyboardBox} = Main.layoutManager;
this.get_parent().set_child_above_sibling(this, keyboardBox);
} else {
this.close(BoxPointer.PopupAnimation.NONE);
if (params.showLabel)
styleClass += ' overview-icon-with-label';
- super._init({ style_class: styleClass });
+ super._init({style_class: styleClass});
this._box = new St.BoxLayout({
vertical: true,
this.set_child(this._box);
this.iconSize = ICON_SIZE;
- this._iconBin = new St.Bin({ x_align: Clutter.ActorAlign.CENTER });
+ this._iconBin = new St.Bin({x_align: Clutter.ActorAlign.CENTER});
this._box.add_actor(this._iconBin);
if (params.showLabel) {
- this.label = new St.Label({ text: label });
+ this.label = new St.Label({text: label});
this.label.clutter_text.set({
x_align: Clutter.ActorAlign.CENTER,
y_align: Clutter.ActorAlign.CENTER,
if (this._setSizeManually) {
size = this.iconSize;
} else {
- const { scaleFactor } =
+ const {scaleFactor} =
St.ThemeContext.get_for_stage(global.stage);
let [found, len] = node.lookup_length('icon-size', false);
}
_appendPage() {
- this._pages.push({ children: [] });
+ this._pages.push({children: []});
this.emit('pages-changed');
}
}
_findBestModeForSize(width, height) {
- const { pagePadding } = this.layout_manager;
+ const {pagePadding} = this.layout_manager;
width -= pagePadding.left + pagePadding.right;
height -= pagePadding.top + pagePadding.bottom;
_init() {
super._init();
- this._a11ySettings = new Gio.Settings({ schema_id: KEYBOARD_A11Y_SCHEMA });
+ this._a11ySettings = new Gio.Settings({schema_id: KEYBOARD_A11Y_SCHEMA});
let seat = Clutter.get_default_backend().get_default_seat();
seat.connect('kbd-a11y-flags-changed',
return;
}
- let content = new Dialog.MessageDialogContent({ title, description });
+ let content = new Dialog.MessageDialogContent({title, description});
dialog.contentLayout.add_child(content);
dialog.addButton({
}
add(word, callback) {
- let button = new St.Button({ label: word });
+ let button = new St.Button({label: word});
button.connect('button-press-event', () => {
callback();
return Clutter.EVENT_STOP;
}, class Key extends St.BoxLayout {
_init(params, extendedKeys = []) {
const {label, iconName, commitString, keyval} = {keyval: 0, ...params};
- super._init({ style_class: 'key-container' });
+ super._init({style_class: 'key-container'});
this._keyval = parseInt(keyval, 16);
this.keyButton = this._makeKey(commitString, label, iconName);
GLib.MININT32, GLib.MAXINT32, 0),
},
Signals: {
- 'emoji': { param_types: [GObject.TYPE_STRING] },
+ 'emoji': {param_types: [GObject.TYPE_STRING]},
'page-changed': {
param_types: [GObject.TYPE_INT, GObject.TYPE_INT, GObject.TYPE_INT],
},
if (j % itemsPerPage == 0) {
page++;
pageKeys = [];
- this._pages.push({ pageKeys, nPages, page, section: this._sections[i] });
+ this._pages.push({pageKeys, nPages, page, section: this._sections[i]});
}
pageKeys.push(section.keys[j]);
const EmojiSelection = GObject.registerClass({
Signals: {
- 'emoji-selected': { param_types: [GObject.TYPE_STRING] },
+ 'emoji-selected': {param_types: [GObject.TYPE_STRING]},
'close-request': {},
'toggle': {},
},
});
this._sections = [
- { first: 'grinning face', label: '🙂️' },
- { first: 'selfie', label: '👍️' },
- { first: 'monkey face', label: '🌷️' },
- { first: 'grapes', label: '🍴️' },
- { first: 'globe showing Europe-Africa', label: '✈️' },
- { first: 'jack-o-lantern', label: '🏃️' },
- { first: 'muted speaker', label: '🔔️' },
- { first: 'ATM sign', label: '❤️' },
- { first: 'chequered flag', label: '🚩️' },
+ {first: 'grinning face', label: '🙂️'},
+ {first: 'selfie', label: '👍️'},
+ {first: 'monkey face', label: '🌷️'},
+ {first: 'grapes', label: '🍴️'},
+ {first: 'globe showing Europe-Africa', label: '✈️'},
+ {first: 'jack-o-lantern', label: '🏃️'},
+ {first: 'muted speaker', label: '🔔️'},
+ {first: 'ATM sign', label: '❤️'},
+ {first: 'chequered flag', label: '🚩️'},
];
this._gridLayout = gridLayout;
/* Create the key */
let label = emoji[currentKey].char + String.fromCharCode(0xFE0F);
- currentSection.keys.push({ label, variants });
+ currentSection.keys.push({label, variants});
currentKey = i;
variants = [];
}
const Keypad = GObject.registerClass({
Signals: {
- 'keyval': { param_types: [GObject.TYPE_UINT] },
+ 'keyval': {param_types: [GObject.TYPE_UINT]},
},
}, class Keypad extends AspectContainer {
_init() {
let keys = [
- { label: '1', keyval: Clutter.KEY_1, left: 0, top: 0 },
- { label: '2', keyval: Clutter.KEY_2, left: 1, top: 0 },
- { label: '3', keyval: Clutter.KEY_3, left: 2, top: 0 },
- { label: '4', keyval: Clutter.KEY_4, left: 0, top: 1 },
- { label: '5', keyval: Clutter.KEY_5, left: 1, top: 1 },
- { label: '6', keyval: Clutter.KEY_6, left: 2, top: 1 },
- { label: '7', keyval: Clutter.KEY_7, left: 0, top: 2 },
- { label: '8', keyval: Clutter.KEY_8, left: 1, top: 2 },
- { label: '9', keyval: Clutter.KEY_9, left: 2, top: 2 },
- { label: '0', keyval: Clutter.KEY_0, left: 1, top: 3 },
- { keyval: Clutter.KEY_BackSpace, icon: 'edit-clear-symbolic', left: 3, top: 0 },
- { keyval: Clutter.KEY_Return, extraClassName: 'enter-key', icon: 'keyboard-enter-symbolic', left: 3, top: 1, height: 2 },
+ {label: '1', keyval: Clutter.KEY_1, left: 0, top: 0},
+ {label: '2', keyval: Clutter.KEY_2, left: 1, top: 0},
+ {label: '3', keyval: Clutter.KEY_3, left: 2, top: 0},
+ {label: '4', keyval: Clutter.KEY_4, left: 0, top: 1},
+ {label: '5', keyval: Clutter.KEY_5, left: 1, top: 1},
+ {label: '6', keyval: Clutter.KEY_6, left: 2, top: 1},
+ {label: '7', keyval: Clutter.KEY_7, left: 0, top: 2},
+ {label: '8', keyval: Clutter.KEY_8, left: 1, top: 2},
+ {label: '9', keyval: Clutter.KEY_9, left: 2, top: 2},
+ {label: '0', keyval: Clutter.KEY_0, left: 1, top: 3},
+ {keyval: Clutter.KEY_BackSpace, icon: 'edit-clear-symbolic', left: 3, top: 0},
+ {keyval: Clutter.KEY_Return, extraClassName: 'enter-key', icon: 'keyboard-enter-symbolic', left: 3, top: 1, height: 2},
];
super._init({
column_homogeneous: true,
row_homogeneous: true,
});
- this._box = new St.Widget({ layout_manager: gridLayout, x_expand: true, y_expand: true });
+ this._box = new St.Widget({layout_manager: gridLayout, x_expand: true, y_expand: true});
this.add_child(this._box);
for (let i = 0; i < keys.length; i++) {
super();
this._keyboard = null;
- this._a11yApplicationsSettings = new Gio.Settings({ schema_id: A11Y_APPLICATIONS_SCHEMA });
+ this._a11yApplicationsSettings = new Gio.Settings({schema_id: A11Y_APPLICATIONS_SCHEMA});
this._a11yApplicationsSettings.connect('changed', this._syncEnabled.bind(this));
this._seat = Clutter.get_default_backend().get_default_seat();
this._pendingLoadBackground = false;
// Set up stage hierarchy to group all UI actors under one container.
- this.uiGroup = new UiActor({ name: 'uiGroup' });
+ this.uiGroup = new UiActor({name: 'uiGroup'});
this.uiGroup.set_flags(Clutter.ActorFlags.NO_LAYOUT);
global.stage.add_child(this.uiGroup);
// A dummy actor that tracks the mouse or text cursor, based on the
// position and size set in setDummyCursorGeometry.
- this.dummyCursor = new St.Widget({ width: 0, height: 0, opacity: 0 });
+ this.dummyCursor = new St.Widget({width: 0, height: 0, opacity: 0});
this.uiGroup.add_actor(this.dummyCursor);
let feedbackGroup = Meta.get_feedback_group_for_display(global.display);
findIndexForActor(actor) {
let [x, y] = actor.get_transformed_position();
let [w, h] = actor.get_transformed_size();
- let rect = new Meta.Rectangle({ x, y, width: w, height: h });
+ let rect = new Meta.Rectangle({x, y, width: w, height: h});
return global.display.get_monitor_index_for_rect(rect);
}
h = Math.round(h);
if (actorData.affectsInputRegion && wantsInputRegion && actorData.actor.get_paint_visibility())
- rects.push(new Meta.Rectangle({ x, y, width: w, height: h }));
+ rects.push(new Meta.Rectangle({x, y, width: w, height: h}));
let monitor = null;
if (actorData.affectsStruts)
continue;
}
- let strutRect = new Meta.Rectangle({ x: x1, y: y1, width: x2 - x1, height: y2 - y1 });
- let strut = new Meta.Strut({ rect: strutRect, side });
+ let strutRect = new Meta.Rectangle({x: x1, y: y1, width: x2 - x1, height: y2 - y1});
+ let strut = new Meta.Strut({rect: strutRect, side});
struts.push(strut);
}
}
const ScreenTransition = GObject.registerClass(
class ScreenTransition extends Clutter.Actor {
_init() {
- super._init({ visible: false });
+ super._init({visible: false});
}
vfunc_hide() {
this._radialEffect = params.radialEffect;
if (this._radialEffect)
- this.add_effect(new RadialShaderEffect({ name: 'radial' }));
+ this.add_effect(new RadialShaderEffect({name: 'radial'}));
else
- this.set({ opacity: 0, style_class: 'lightbox' });
+ this.set({opacity: 0, style_class: 'lightbox'});
container.add_actor(this);
container.set_child_above_sibling(this, null);
'@effects.radial.brightness', VIGNETTE_BRIGHTNESS, easeProps);
this.ease_property(
'@effects.radial.sharpness', VIGNETTE_SHARPNESS,
- Object.assign({ onComplete }, easeProps));
+ Object.assign({onComplete}, easeProps));
} else {
this.ease(Object.assign(easeProps, {
opacity: 255 * this._fadeFactor,
this.ease_property(
'@effects.radial.brightness', 1.0, easeProps);
this.ease_property(
- '@effects.radial.sharpness', 0.0, Object.assign({ onComplete }, easeProps));
+ '@effects.radial.sharpness', 0.0, Object.assign({onComplete}, easeProps));
} else {
- this.ease(Object.assign(easeProps, { opacity: 0, onComplete }));
+ this.ease(Object.assign(easeProps, {opacity: 0, onComplete}));
}
}
export class LocatePointer {
constructor() {
- this._settings = new Gio.Settings({ schema_id: LOCATE_POINTER_SCHEMA });
+ this._settings = new Gio.Settings({schema_id: LOCATE_POINTER_SCHEMA});
this._settings.connect(`changed::${LOCATE_POINTER_KEY}`, () => this._syncEnabled());
this._syncEnabled();
}
const CLUTTER_DEBUG_FLAG_CATEGORIES = new Map([
// Paint debugging can easily result in a non-responsive session
- ['DebugFlag', { argPos: 0, exclude: ['PAINT'] }],
- ['DrawDebugFlag', { argPos: 1, exclude: [] }],
+ ['DebugFlag', {argPos: 0, exclude: ['PAINT']}],
+ ['DrawDebugFlag', {argPos: 1, exclude: []}],
// Exluded due to the only current option likely to result in shooting ones
// foot
// ['PickDebugFlag', { argPos: 2, exclude: [] }],
// multiple matches + double tab = emit a suggest event with all possible options
if (event.completions.length == 1) {
this.additionalCompletionText(event.completions[0], event.attrHead);
- this.emit('completion', { completion: event.completions[0], type: 'whole-word' });
+ this.emit('completion', {completion: event.completions[0], type: 'whole-word'});
} else if (event.completions.length > 1 && event.tabType === 'single') {
let commonPrefix = JsParse.getCommonPrefix(event.completions);
if (commonPrefix.length > 0) {
this.additionalCompletionText(commonPrefix, event.attrHead);
- this.emit('completion', { completion: commonPrefix, type: 'prefix' });
- this.emit('suggest', { completions: event.completions });
+ this.emit('completion', {completion: commonPrefix, type: 'prefix'});
+ this.emit('suggest', {completions: event.completions});
}
} else if (event.completions.length > 1 && event.tabType === 'double') {
- this.emit('suggest', { completions: event.completions });
+ this.emit('suggest', {completions: event.completions});
}
}
}
const Notebook = GObject.registerClass({
- Signals: { 'selection': { param_types: [Clutter.Actor.$gtype] } },
+ Signals: {'selection': {param_types: [Clutter.Actor.$gtype]}},
}, class Notebook extends St.BoxLayout {
_init() {
super._init({
y_expand: true,
});
- this.tabControls = new St.BoxLayout({ style_class: 'labels' });
+ this.tabControls = new St.BoxLayout({style_class: 'labels'});
this._selectedIndex = -1;
this._tabs = [];
reactive: true,
track_hover: true,
});
- let label = new St.Button({ label: name });
+ let label = new St.Button({label: name});
label.connect('clicked', () => {
this.selectChild(child);
return true;
labelBox.add_child(label);
this.tabControls.add(labelBox);
- let scrollview = new St.ScrollView({ y_expand: true });
+ let scrollview = new St.ScrollView({y_expand: true});
scrollview.get_hscroll_bar().hide();
scrollview.add_actor(child);
const Result = GObject.registerClass(
class Result extends St.BoxLayout {
_init(lookingGlass, command, o, index) {
- super._init({ vertical: true });
+ super._init({vertical: true});
this.index = index;
this.o = o;
this._lookingGlass = lookingGlass;
- let cmdTxt = new St.Label({ text: command });
+ let cmdTxt = new St.Label({text: command});
cmdTxt.clutter_text.ellipsize = Pango.EllipsizeMode.END;
this.add(cmdTxt);
let box = new St.BoxLayout({});
this.add(box);
- let resultTxt = new St.Label({ text: `r(${index}) = ` });
+ let resultTxt = new St.Label({text: `r(${index}) = `});
resultTxt.clutter_text.ellipsize = Pango.EllipsizeMode.END;
box.add(resultTxt);
let objLink = new ObjLink(this._lookingGlass, o);
const WindowList = GObject.registerClass({
}, class WindowList extends St.BoxLayout {
_init(lookingGlass) {
- super._init({ name: 'Windows', vertical: true, style: 'spacing: 8px' });
+ super._init({name: 'Windows', vertical: true, style: 'spacing: 8px'});
let tracker = Shell.WindowTracker.get_default();
this._updateId = Main.initializeDeferredWork(this, this._updateWindowList.bind(this));
global.display.connect('window-created', this._updateWindowList.bind(this));
metaWindow.connect('unmanaged', this._updateWindowList.bind(this));
metaWindow._lookingGlassManaged = true;
}
- let box = new St.BoxLayout({ vertical: true });
+ let box = new St.BoxLayout({vertical: true});
this.add(box);
let windowLink = new ObjLink(this._lookingGlass, metaWindow, metaWindow.title);
box.add_child(windowLink);
- let propsBox = new St.BoxLayout({ vertical: true, style: 'padding-left: 6px;' });
+ let propsBox = new St.BoxLayout({vertical: true, style: 'padding-left: 6px;'});
box.add(propsBox);
- propsBox.add(new St.Label({ text: `wmclass: ${metaWindow.get_wm_class()}` }));
+ propsBox.add(new St.Label({text: `wmclass: ${metaWindow.get_wm_class()}`}));
let app = tracker.get_window_app(metaWindow);
if (app != null && !app.is_window_backed()) {
let icon = app.create_icon_texture(22);
- let propBox = new St.BoxLayout({ style: 'spacing: 6px; ' });
+ let propBox = new St.BoxLayout({style: 'spacing: 6px; '});
propsBox.add(propBox);
- propBox.add_child(new St.Label({ text: 'app: ' }));
+ propBox.add_child(new St.Label({text: 'app: '}));
let appLink = new ObjLink(this._lookingGlass, app, app.get_id());
propBox.add_child(appLink);
propBox.add_child(icon);
} else {
- propsBox.add(new St.Label({ text: '<untracked>' }));
+ propsBox.add(new St.Label({text: '<untracked>'}));
}
}
}
class ObjInspector extends St.ScrollView {
_init(lookingGlass) {
super._init({
- pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }),
+ pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
});
this._obj = null;
this._container.destroy_all_children();
- let hbox = new St.BoxLayout({ style_class: 'lg-obj-inspector-title' });
+ let hbox = new St.BoxLayout({style_class: 'lg-obj-inspector-title'});
this._container.add_actor(hbox);
let label = new St.Label({
text: `Inspecting: ${typeof obj}: ${objectToString(obj)}`,
});
label.single_line_mode = true;
hbox.add_child(label);
- let button = new St.Button({ label: 'Insert', style_class: 'lg-obj-inspector-button' });
+ let button = new St.Button({label: 'Insert', style_class: 'lg-obj-inspector-button'});
button.connect('clicked', this._onInsert.bind(this));
hbox.add(button);
if (this._previousObj != null) {
- button = new St.Button({ label: 'Back', style_class: 'lg-obj-inspector-button' });
+ button = new St.Button({label: 'Back', style_class: 'lg-obj-inspector-button'});
button.connect('clicked', this._onBack.bind(this));
hbox.add(button);
}
let prop = obj[propName];
link = new ObjLink(this._lookingGlass, prop);
} catch (e) {
- link = new St.Label({ text: '<error>' });
+ link = new St.Label({text: '<error>'});
}
let box = new St.BoxLayout();
- box.add(new St.Label({ text: `${propName}: ` }));
+ box.add(new St.Label({text: `${propName}: `}));
box.add(link);
this._container.add_actor(box);
}
if (this._open)
return;
- const grab = Main.pushModal(this, { actionMode: Shell.ActionMode.LOOKING_GLASS });
+ const grab = Main.pushModal(this, {actionMode: Shell.ActionMode.LOOKING_GLASS});
if (grab.get_seat_state() !== Clutter.GrabState.ALL) {
Main.popModal(grab);
return;
const Inspector = GObject.registerClass({
Signals: {
'closed': {},
- 'target': { param_types: [Clutter.Actor.$gtype, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] },
+ 'target': {param_types: [Clutter.Actor.$gtype, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE]},
},
}, class Inspector extends Clutter.Actor {
_init(lookingGlass) {
- super._init({ width: 0, height: 0 });
+ super._init({width: 0, height: 0});
Main.uiGroup.add_actor(this);
});
this._eventHandler = eventHandler;
this.add_actor(eventHandler);
- this._displayText = new St.Label({ x_expand: true });
+ this._displayText = new St.Label({x_expand: true});
eventHandler.add_child(this._displayText);
eventHandler.connect('key-press-event', this._onKeyPressEvent.bind(this));
const Extensions = GObject.registerClass({
}, class Extensions extends St.BoxLayout {
_init(lookingGlass) {
- super._init({ vertical: true, name: 'lookingGlassExtensions' });
+ super._init({vertical: true, name: 'lookingGlassExtensions'});
this._lookingGlass = lookingGlass;
this._noExtensions = new St.Label({
this._extensionsList.remove_actor(this._noExtensions);
this._numExtensions++;
- const { name } = extension.metadata;
+ const {name} = extension.metadata;
const pos = [...this._extensionsList].findIndex(
dsp => dsp._extension.metadata.name.localeCompare(name) > 0);
this._extensionsList.insert_child_at_index(extensionDisplay, pos);
if (shouldShow) {
let errors = extension.errors;
- let errorDisplay = new St.BoxLayout({ vertical: true });
+ let errorDisplay = new St.BoxLayout({vertical: true});
if (errors && errors.length) {
for (let i = 0; i < errors.length; i++)
- errorDisplay.add(new St.Label({ text: errors[i] }));
+ errorDisplay.add(new St.Label({text: errors[i]}));
} else {
/* Translators: argument is an extension UUID. */
let message = _('%s has not emitted any errors.').format(extension.uuid);
- errorDisplay.add(new St.Label({ text: message }));
+ errorDisplay.add(new St.Label({text: message}));
}
actor._errorDisplay = errorDisplay;
}
_createExtensionDisplay(extension) {
- let box = new St.BoxLayout({ style_class: 'lg-extension', vertical: true });
+ let box = new St.BoxLayout({style_class: 'lg-extension', vertical: true});
box._extension = extension;
let name = new St.Label({
style_class: 'lg-extension-name',
});
box.add_child(description);
- let metaBox = new St.BoxLayout({ style_class: 'lg-extension-meta' });
+ let metaBox = new St.BoxLayout({style_class: 'lg-extension-meta'});
box.add(metaBox);
const state = new St.Label({
style_class: 'lg-extension-state',
icon_size: 8,
x_align: Clutter.ActorAlign.CENTER,
y_align: Clutter.ActorAlign.CENTER,
- pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }),
+ pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
});
const label = new St.Label({
this._lookingGlass.inspectObject(actor, button);
});
- const mainContainer = new St.BoxLayout({ vertical: true });
+ const mainContainer = new St.BoxLayout({vertical: true});
const childrenContainer = new St.BoxLayout({
vertical: true,
style: 'padding: 0 0 0 18px',
// Sort of magic, but...eh.
this._maxItems = 150;
- this._interfaceSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.interface' });
+ this._interfaceSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.interface'});
this._interfaceSettings.connect('changed::monospace-font-name',
this._updateFont.bind(this));
this._updateFont();
Main.uiGroup.add_actor(this._objInspector);
this._objInspector.hide();
- let toolbar = new St.BoxLayout({ name: 'Toolbar' });
+ let toolbar = new St.BoxLayout({name: 'Toolbar'});
this.add_actor(toolbar);
const inspectButton = new St.Button({
style_class: 'lg-toolbar-button',
this._notebook = notebook;
this.add_child(notebook);
- let emptyBox = new St.Bin({ x_expand: true });
+ let emptyBox = new St.Bin({x_expand: true});
toolbar.add_child(emptyBox);
toolbar.add_actor(notebook.tabControls);
- this._evalBox = new St.BoxLayout({ name: 'EvalBox', vertical: true });
+ this._evalBox = new St.BoxLayout({name: 'EvalBox', vertical: true});
notebook.appendPage('Evaluator', this._evalBox);
this._resultsArea = new St.BoxLayout({
});
this._evalBox.add_actor(this._entryArea);
- let label = new St.Label({ text: CHEVRON });
+ let label = new St.Label({text: CHEVRON});
this._entryArea.add(label);
this._entry = new St.Entry({
_showCompletions(completions) {
if (!this._completionActor) {
- this._completionActor = new St.Label({ name: 'LookingGlassAutoCompletionText', style_class: 'lg-completions-text' });
+ this._completionActor = new St.Label({name: 'LookingGlassAutoCompletionText', style_class: 'lg-completions-text'});
this._completionActor.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._completionActor.clutter_text.line_wrap = true;
this._evalBox.insert_child_below(this._completionActor, this._entryArea);
if (this._open)
return;
- let grab = Main.pushModal(this, { actionMode: Shell.ActionMode.LOOKING_GLASS });
+ let grab = Main.pushModal(this, {actionMode: Shell.ActionMode.LOOKING_GLASS});
if (grab.get_seat_state() !== Clutter.GrabState.ALL) {
Main.popModal(grab);
return;
let cursorTracker = Meta.CursorTracker.get_for_display(global.display);
this._cursorTracker = cursorTracker;
- this._mouseSprite = new Clutter.Actor({ request_mode: Clutter.RequestMode.CONTENT_SIZE });
+ this._mouseSprite = new Clutter.Actor({request_mode: Clutter.RequestMode.CONTENT_SIZE});
this._mouseSprite.content = new MouseSpriteContent();
this._cursorRoot = new Clutter.Actor();
}
_settingsInit(zoomRegion) {
- this._settings = new Gio.Settings({ schema_id: MAGNIFIER_SCHEMA });
+ this._settings = new Gio.Settings({schema_id: MAGNIFIER_SCHEMA});
this._settings.connect(`changed::${SCREEN_POSITION_KEY}`,
this._updateScreenPosition.bind(this));
this._screenPosition = GDesktopEnums.MagnifierScreenPosition.FULL_SCREEN;
this._invertLightness = false;
this._colorSaturation = 1.0;
- this._brightness = { r: NO_CHANGE, g: NO_CHANGE, b: NO_CHANGE };
- this._contrast = { r: NO_CHANGE, g: NO_CHANGE, b: NO_CHANGE };
+ this._brightness = {r: NO_CHANGE, g: NO_CHANGE, b: NO_CHANGE};
+ this._contrast = {r: NO_CHANGE, g: NO_CHANGE, b: NO_CHANGE};
this._magView = null;
this._background = null;
throw new Error(`Failed to validate parent window: ${e}`);
}
- const { focusWindow } = global.display;
+ const {focusWindow} = global.display;
if (!focusWindow)
return null;
scrollToMousePos() {
this._followingCursor = true;
if (this._mouseTrackingMode != GDesktopEnums.MagnifierMouseTrackingMode.NONE)
- this._changeROI({ redoCursorTracking: true });
+ this._changeROI({redoCursorTracking: true});
else
this._updateMousePosition();
_createActors() {
// The root actor for the zoom region
- this._magView = new St.Bin({ style_class: 'magnifier-zoom-region' });
+ this._magView = new St.Bin({style_class: 'magnifier-zoom-region'});
global.stage.add_actor(this._magView);
// hide the magnified region from CLUTTER_PICK_ALL
Shell.util_set_hidden_from_pick(this._magView, true);
// Add a group to clip the contents of the magnified view.
- let mainGroup = new Clutter.Actor({ clip_to_allocation: true });
+ let mainGroup = new Clutter.Actor({clip_to_allocation: true});
this._magView.set_child(mainGroup);
// Add a background for when the magnified uiGroup is scrolled
// Add either the given mouseSourceActor to the ZoomRegion, or a clone of
// it.
if (this._mouseSourceActor.get_parent() != null)
- this._mouseActor = new Clutter.Clone({ source: this._mouseSourceActor });
+ this._mouseActor = new Clutter.Clone({source: this._mouseSourceActor});
else
this._mouseActor = this._mouseSourceActor;
mainGroup.add_actor(this._mouseActor);
this._updateMagViewGeometry();
if (!fromROIUpdate)
- this._changeROI({ redoCursorTracking: this._followingCursor }); // will update mouse
+ this._changeROI({redoCursorTracking: this._followingCursor}); // will update mouse
if (this.isActive() && this._isMouseOverRegion())
this._magnifier.hideSystemCursor();
if (container) {
crosshairsActor = this;
if (this.get_parent() != null) {
- crosshairsActor = new Clutter.Clone({ source: this });
+ crosshairsActor = new Clutter.Clone({source: this});
this._clones.push(crosshairsActor);
// Clones don't share visibility.
let titleBox = new St.BoxLayout();
contentBox.add_actor(titleBox);
- this.titleLabel = new St.Label({ style_class: 'message-title' });
+ this.titleLabel = new St.Label({style_class: 'message-title'});
this.setTitle(title);
titleBox.add_actor(this.titleLabel);
});
titleBox.add_actor(this._closeButton);
- this._bodyStack = new St.Widget({ x_expand: true });
+ this._bodyStack = new St.Widget({x_expand: true});
this._bodyStack.layout_manager = new LabelExpanderLayout();
contentBox.add_actor(this._bodyStack);
Signals: {
'can-clear-changed': {},
'empty-changed': {},
- 'message-focused': { param_types: [Message.$gtype] },
+ 'message-focused': {param_types: [Message.$gtype]},
},
}, class MessageListSection extends St.BoxLayout {
_init() {
let listItem = new St.Bin({
child: message,
layout_manager: new ScaleLayout(),
- pivot_point: new Graphene.Point({ x: .5, y: .5 }),
+ pivot_point: new Graphene.Point({x: .5, y: .5}),
});
listItem._connectionsIds = [];
this._list.insert_child_at_index(listItem, index);
if (animate) {
- listItem.set({ scale_x: 0, scale_y: 0 });
+ listItem.set({scale_x: 0, scale_y: 0});
listItem.ease({
scale_x: 1,
scale_y: 1,
super._init();
this.id = 'generic';
- this._masterSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.notifications' });
+ this._masterSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.notifications'});
this._masterSettings.connect('changed', this._changed.bind(this));
}
this.id = id;
this._canonicalId = this._canonicalizeId(id);
- this._masterSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.notifications' });
+ this._masterSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.notifications'});
this._settings = new Gio.Settings({
schema_id: 'org.gnome.desktop.notifications.application',
path: `/org/gnome/desktop/notifications/application/${this._canonicalId}/`,
},
Signals: {
'activated': {},
- 'destroy': { param_types: [GObject.TYPE_UINT] },
- 'updated': { param_types: [GObject.TYPE_BOOLEAN] },
+ 'destroy': {param_types: [GObject.TYPE_UINT]},
+ 'updated': {param_types: [GObject.TYPE_BOOLEAN]},
},
}, class Notification extends GObject.Object {
_init(source, title, banner, params) {
// @label: the label for the action's button
// @callback: the callback for the action
addAction(label, callback) {
- this.actions.push({ label, callback });
+ this.actions.push({label, callback});
}
setUrgency(urgency) {
null),
},
Signals: {
- 'destroy': { param_types: [GObject.TYPE_UINT] },
+ 'destroy': {param_types: [GObject.TYPE_UINT]},
'icon-updated': {},
- 'notification-added': { param_types: [Notification.$gtype] },
- 'notification-show': { param_types: [Notification.$gtype] },
+ 'notification-added': {param_types: [Notification.$gtype]},
+ 'notification-show': {param_types: [Notification.$gtype]},
},
}, class Source extends GObject.Object {
_init(title, iconName) {
- super._init({ title });
+ super._init({title});
this.SOURCE_ICON_SIZE = 48;
}
getIcon() {
- return new Gio.ThemedIcon({ name: this.iconName });
+ return new Gio.ThemedIcon({name: this.iconName});
}
_onNotificationDestroy(notification) {
export const MessageTray = GObject.registerClass({
Signals: {
'queue-changed': {},
- 'source-added': { param_types: [Source.$gtype] },
- 'source-removed': { param_types: [Source.$gtype] },
+ 'source-added': {param_types: [Source.$gtype]},
+ 'source-removed': {param_types: [Source.$gtype]},
},
}, class MessageTray extends St.Widget {
_init() {
this._onStatusChanged(status);
});
- let constraint = new Layout.MonitorConstraint({ primary: true });
+ let constraint = new Layout.MonitorConstraint({primary: true});
Main.layoutManager.panelBox.bind_property('visible',
constraint, 'work-area',
GObject.BindingFlags.SYNC_CREATE);
this._notificationTimeoutId = 0;
this._notificationRemoved = false;
- Main.layoutManager.addChrome(this, { affectsInputRegion: false });
- Main.layoutManager.trackChrome(this._bannerBin, { affectsInputRegion: true });
+ Main.layoutManager.addChrome(this, {affectsInputRegion: false});
+ Main.layoutManager.trackChrome(this._bannerBin, {affectsInputRegion: true});
global.display.connect('in-fullscreen-changed', this._updateState.bind(this));
this._onDragEnd.bind(this));
Main.wm.addKeybinding('focus-active-notification',
- new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
+ new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}),
Meta.KeyBindingFlags.NONE,
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
Math.max(...Object.values(State)),
State.CLOSED),
},
- Signals: { 'opened': {}, 'closed': {} },
+ Signals: {'opened': {}, 'closed': {}},
}, class ModalDialog extends St.Widget {
_init(params) {
super._init({
x_expand: true,
y_expand: true,
});
- this._backgroundBin = new St.Bin({ child: this.backgroundStack });
+ this._backgroundBin = new St.Bin({child: this.backgroundStack});
this._monitorConstraint = new Layout.MonitorConstraint();
this._backgroundBin.add_constraint(this._monitorConstraint);
this.add_actor(this._backgroundBin);
});
this._lightbox.highlight(this._backgroundBin);
- this._eventBlocker = new Clutter.Actor({ reactive: true });
+ this._eventBlocker = new Clutter.Actor({reactive: true});
this.backgroundStack.add_actor(this._eventBlocker);
}
if (this._hasModal)
return true;
- let params = { actionMode: this._actionMode };
+ let params = {actionMode: this._actionMode};
if (timestamp)
params['timestamp'] = timestamp;
let grab = Main.pushModal(this, params);
this._player = player;
- this._icon = new St.Icon({ style_class: 'media-message-cover-icon' });
+ this._icon = new St.Icon({style_class: 'media-message-cover-icon'});
this.setIcon(this._icon);
// reclaim space used by unused elements
stockIcon = 'dialog-error';
break;
}
- return new Gio.ThemedIcon({ name: stockIcon });
+ return new Gio.ThemedIcon({name: stockIcon});
}
_iconForNotificationData(icon) {
if (icon) {
if (icon.substr(0, 7) == 'file://')
- return new Gio.FileIcon({ file: Gio.File.new_for_uri(icon) });
+ return new Gio.FileIcon({file: Gio.File.new_for_uri(icon)});
else if (icon[0] == '/')
- return new Gio.FileIcon({ file: Gio.File.new_for_path(icon) });
+ return new Gio.FileIcon({file: Gio.File.new_for_path(icon)});
else
- return new Gio.ThemedIcon({ name: icon });
+ return new Gio.ThemedIcon({name: icon});
}
return null;
}
hints[hint] = hints[hint].deepUnpack();
}
- hints = Params.parse(hints, { urgency: Urgency.NORMAL }, true);
+ hints = Params.parse(hints, {urgency: Urgency.NORMAL}, true);
// Filter out chat, presence, calls and invitation notifications from
// Empathy, since we handle that information from telepathyClient.js
}
_notifyForSource(source, ndata) {
- const { icon, summary, body, actions, hints } = ndata;
- let { notification } = ndata;
+ const {icon, summary, body, actions, hints} = ndata;
+ let {notification} = ndata;
if (notification == null) {
notification = new MessageTray.Notification(source);
}
_onButtonClicked(button) {
- let { action, target } = button;
+ let {action, target} = button;
this._activateAction(action.unpack(), target);
}
const OsdMonitorLabel = GObject.registerClass(
class OsdMonitorLabel extends St.Widget {
_init(monitor, label) {
- super._init({ x_expand: true, y_expand: true });
+ super._init({x_expand: true, y_expand: true});
this._monitor = monitor;
});
this._monitorIndex = monitorIndex;
- let constraint = new Layout.MonitorConstraint({ index: monitorIndex });
+ let constraint = new Layout.MonitorConstraint({index: monitorIndex});
this.add_constraint(constraint);
this._hbox = new St.BoxLayout({
});
this.add_actor(this._hbox);
- this._icon = new St.Icon({ y_expand: true });
+ this._icon = new St.Icon({y_expand: true});
this._hbox.add_child(this._icon);
this._vbox = new St.BoxLayout({
notification.setForFeedback(forFeedback);
} else {
notification = this._source.notifications[0];
- notification.update(text, null, { clear: true });
+ notification.update(text, null, {clear: true});
}
if (undoCallback)
vertical: true,
});
- this.add_constraint(new LayoutManager.MonitorConstraint({ primary: true }));
+ this.add_constraint(new LayoutManager.MonitorConstraint({primary: true}));
this._controls = new OverviewControls.ControlsManager();
this.add_child(this._controls);
}
_sessionUpdated() {
- const { hasOverview } = Main.sessionMode;
+ const {hasOverview} = Main.sessionMode;
if (!hasOverview)
this.hide();
Main.wm.addKeybinding(
'toggle-overview',
- new Gio.Settings({ schema_id: WindowManager.SHELL_KEYBINDINGS_SCHEMA }),
+ new Gio.Settings({schema_id: WindowManager.SHELL_KEYBINDINGS_SCHEMA}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
this.toggle.bind(this));
const swipeTracker = new SwipeTracker.SwipeTracker(global.stage,
Clutter.Orientation.VERTICAL,
Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
- { allowDrag: false, allowScroll: false });
+ {allowDrag: false, allowScroll: false});
swipeTracker.orientation = Clutter.Orientation.VERTICAL;
swipeTracker.connect('begin', this._gestureBegin.bind(this));
swipeTracker.connect('update', this._gestureUpdate.bind(this));
class ControlsManagerLayout extends Clutter.BoxLayout {
_init(searchEntry, appDisplay, workspacesDisplay, workspacesThumbnails,
searchController, dash, stateAdjustment) {
- super._init({ orientation: Clutter.Orientation.VERTICAL });
+ super._init({orientation: Clutter.Orientation.VERTICAL});
this._appDisplay = appDisplay;
this._workspacesDisplay = workspacesDisplay;
vfunc_allocate(container, box) {
const childBox = new Clutter.ActorBox();
- const { spacing } = this;
+ const {spacing} = this;
const startY = this._workAreaBox.y1;
box.y1 += startY;
// Workspace Thumbnails
let thumbnailsHeight = 0;
if (this._workspacesThumbnails.visible) {
- const { expandFraction } = this._workspacesThumbnails;
+ const {expandFraction} = this._workspacesThumbnails;
[thumbnailsHeight] =
this._workspacesThumbnails.get_preferred_height(width);
thumbnailsHeight = Math.min(
},
});
- this._a11ySettings = new Gio.Settings({ schema_id: A11Y_SCHEMA });
+ this._a11ySettings = new Gio.Settings({schema_id: A11Y_SCHEMA});
this._lastOverlayKeyTime = 0;
global.display.connect('overlay-key', () => {
if (this._a11ySettings.get_boolean('stickykeys-enable'))
return;
- const { initialState, finalState, transitioning } =
+ const {initialState, finalState, transitioning} =
this._stateAdjustment.getStateTransitionParams();
const time = GLib.get_monotonic_time() / 1000;
!this.contains(global.stage.key_focus))
return Clutter.EVENT_PROPAGATE;
- const { finalState } =
+ const {finalState} =
this._stateAdjustment.getStateTransitionParams();
let keynavDisplay;
Main.wm.addKeybinding(
'toggle-application-view',
- new Gio.Settings({ schema_id: WindowManager.SHELL_KEYBINDINGS_SCHEMA }),
+ new Gio.Settings({schema_id: WindowManager.SHELL_KEYBINDINGS_SCHEMA}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
this._toggleAppsPage.bind(this));
Main.wm.addKeybinding('shift-overview-up',
- new Gio.Settings({ schema_id: WindowManager.SHELL_KEYBINDINGS_SCHEMA }),
+ new Gio.Settings({schema_id: WindowManager.SHELL_KEYBINDINGS_SCHEMA}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
() => this._shiftState(Meta.MotionDirection.UP));
}
_getThumbnailsBoxParams() {
- const { initialState, finalState, progress } =
+ const {initialState, finalState, progress} =
this._stateAdjustment.getStateTransitionParams();
const paramsForState = s => {
break;
}
- return { opacity, scale, translationY };
+ return {opacity, scale, translationY};
};
const initialParams = paramsForState(initialState);
}
_updateThumbnailsBox(animate = false) {
- const { shouldShow } = this._thumbnailsBox;
- const { searchActive } = this._searchController;
+ const {shouldShow} = this._thumbnailsBox;
+ const {searchActive} = this._searchController;
const [opacity, scale, translationY] = this._getThumbnailsBoxParams();
const thumbnailsBoxVisible = shouldShow && !searchActive && opacity !== 0;
if (!stateTransitionParams)
stateTransitionParams = this._stateAdjustment.getStateTransitionParams();
- const { initialState, finalState } = stateTransitionParams;
+ const {initialState, finalState} = stateTransitionParams;
const state = Math.max(initialState, finalState);
this._appDisplay.visible =
this._getFitModeForState(params.finalState),
params.progress);
- const { fitModeAdjustment } = this._workspacesDisplay;
+ const {fitModeAdjustment} = this._workspacesDisplay;
fitModeAdjustment.value = fitMode;
this._updateThumbnailsBox();
}
_onSearchChanged() {
- const { searchActive } = this._searchController;
+ const {searchActive} = this._searchController;
if (!searchActive) {
this._updateAppDisplayVisibility();
}
_shiftState(direction) {
- let { currentState, finalState } = this._stateAdjustment.getStateTransitionParams();
+ let {currentState, finalState} = this._stateAdjustment.getStateTransitionParams();
if (direction === Meta.MotionDirection.DOWN)
finalState = Math.max(finalState - 1, ControlsState.HIDDEN);
// We can't run the animation before the first allocation happens
await this.layout_manager.ensureAllocation();
- const { STARTUP_ANIMATION_TIME } = Layout;
+ const {STARTUP_ANIMATION_TIME} = Layout;
// Opacity
this.ease({
});
// Search bar falls from the ceiling
- const { primaryMonitor } = Main.layoutManager;
+ const {primaryMonitor} = Main.layoutManager;
const [, y] = this._searchEntryBin.get_transformed_position();
const yOffset = y - primaryMonitor.y;
const RTL = 1;
const PadChooser = GObject.registerClass({
- Signals: { 'pad-selected': { param_types: [Clutter.InputDevice.$gtype] } },
+ Signals: {'pad-selected': {param_types: [Clutter.InputDevice.$gtype]}},
}, class PadChooser extends St.Button {
_init(device, groupDevices) {
super._init({
});
const KeybindingEntry = GObject.registerClass({
- Signals: { 'keybinding-edited': { param_types: [GObject.TYPE_STRING] } },
+ Signals: {'keybinding-edited': {param_types: [GObject.TYPE_STRING]}},
}, class KeybindingEntry extends St.Entry {
_init() {
super._init({hint_text: _('New shortcut…'), style: 'width: 10em'});
});
const ActionComboBox = GObject.registerClass({
- Signals: { 'action-selected': { param_types: [GObject.TYPE_INT] } },
+ Signals: {'action-selected': {param_types: [GObject.TYPE_INT]}},
}, class ActionComboBox extends St.Button {
_init() {
- super._init({ style_class: 'button' });
+ super._init({style_class: 'button'});
this.set_toggle_mode(true);
const boxLayout = new Clutter.BoxLayout({
orientation: Clutter.Orientation.HORIZONTAL,
spacing: 6,
});
- let box = new St.Widget({ layout_manager: boxLayout });
+ let box = new St.Widget({layout_manager: boxLayout});
this.set_child(box);
- this._label = new St.Label({ style_class: 'combo-box-label' });
+ this._label = new St.Label({style_class: 'combo-box-label'});
box.add_child(this._label);
const arrow = new St.Icon({
});
const ActionEditor = GObject.registerClass({
- Signals: { 'done': {} },
+ Signals: {'done': {}},
}, class ActionEditor extends St.Widget {
_init() {
const boxLayout = new Clutter.BoxLayout({
spacing: 12,
});
- super._init({ layout_manager: boxLayout });
+ super._init({layout_manager: boxLayout});
this._actionComboBox = new ActionComboBox();
this._actionComboBox.connect('action-selected', this._onActionSelected.bind(this));
this._updateDiagramScale();
for (let i = 0; i < this._labels.length; i++) {
- const { label, x, y, arrangement } = this._labels[i];
+ const {label, x, y, arrangement} = this._labels[i];
this._allocateChild(label, x, y, arrangement);
}
if (this._editorActor && this._curEdited) {
- const { x, y, arrangement } = this._curEdited;
+ const {x, y, arrangement} = this._curEdited;
this._allocateChild(this._editorActor, x, y, arrangement);
}
}
return false;
let label = new St.Label();
- this._labels.push({ label, action, idx, dir, x, y, arrangement });
+ this._labels.push({label, action, idx, dir, x, y, arrangement});
this.add_actor(label);
return true;
}
updateLabels(getText) {
for (let i = 0; i < this._labels.length; i++) {
- const { label, action, idx, dir } = this._labels[i];
+ const {label, action, idx, dir} = this._labels[i];
let str = getText(action, idx, dir);
label.set_text(str);
}
this._editorActor.hide();
if (this._curEdited) {
- const { label, action, idx, dir } = this._curEdited;
+ const {label, action, idx, dir} = this._curEdited;
this._applyLabel(label, action, idx, dir, str);
this._curEdited = null;
}
export const PadOsd = GObject.registerClass({
Signals: {
- 'pad-selected': { param_types: [Clutter.InputDevice.$gtype] },
+ 'pad-selected': {param_types: [Clutter.InputDevice.$gtype]},
'closed': {},
},
}, class PadOsd extends St.BoxLayout {
Main.uiGroup.add_actor(this);
this._monitorIndex = monitorIndex;
- let constraint = new Layout.MonitorConstraint({ index: monitorIndex });
+ let constraint = new Layout.MonitorConstraint({index: monitorIndex});
this.add_constraint(constraint);
this._titleBox = new St.BoxLayout({
this._titleLabel.clutter_text.set_text(padDevice.get_device_name());
labelBox.add_actor(this._titleLabel);
- this._tipLabel = new St.Label({ x_align: Clutter.ActorAlign.CENTER });
+ this._tipLabel = new St.Label({x_align: Clutter.ActorAlign.CENTER});
labelBox.add_actor(this._tipLabel);
this._updatePadChooser();
return;
this._endActionEdition();
- this._editedAction = { type, number, dir, mode };
+ this._editedAction = {type, number, dir, mode};
const settingsPath = `${this._settings.path}${key}/`;
this._editedActionSettings = Gio.Settings.new_with_path('org.gnome.desktop.peripherals.tablet.pad-button',
const INDICATOR_INACTIVE_SCALE_PRESSED = 0.5;
export const PageIndicators = GObject.registerClass({
- Signals: { 'page-activated': { param_types: [GObject.TYPE_INT] } },
+ Signals: {'page-activated': {param_types: [GObject.TYPE_INT]}},
}, class PageIndicators extends St.BoxLayout {
_init(orientation = Clutter.Orientation.VERTICAL) {
let vertical = orientation == Clutter.Orientation.VERTICAL;
});
indicator.child = new St.Widget({
style_class: 'page-indicator-icon',
- pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }),
+ pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
});
indicator.connect('clicked', () => {
this.emit('page-activated', pageIndex);
this._menuManager = panel.menuManager;
this._targetApp = null;
- let bin = new St.Bin({ name: 'appMenu' });
+ let bin = new St.Bin({name: 'appMenu'});
this.add_actor(bin);
this.bind_property('reactive', this, 'can-focus', 0);
this.reactive = false;
- this._container = new St.BoxLayout({ style_class: 'panel-status-menu-box' });
+ this._container = new St.BoxLayout({style_class: 'panel-status-menu-box'});
bin.set_child(this._container);
let textureCache = St.TextureCache.get_default();
this.menuManager = new PopupMenu.PopupMenuManager(this);
- this._leftBox = new St.BoxLayout({ name: 'panelLeft' });
+ this._leftBox = new St.BoxLayout({name: 'panelLeft'});
this.add_child(this._leftBox);
- this._centerBox = new St.BoxLayout({ name: 'panelCenter' });
+ this._centerBox = new St.BoxLayout({name: 'panelCenter'});
this.add_child(this._centerBox);
- this._rightBox = new St.BoxLayout({ name: 'panelRight' });
+ this._rightBox = new St.BoxLayout({name: 'panelRight'});
this.add_child(this._rightBox);
this.connect('button-press-event', this._onButtonPress.bind(this));
Main.layoutManager.panelBox.add(this);
Main.ctrlAltTabManager.addGroup(this, _('Top Bar'), 'focus-top-bar-symbolic',
- { sortGroup: CtrlAltTab.SortGroup.TOP });
+ {sortGroup: CtrlAltTab.SortGroup.TOP});
Main.sessionMode.connect('updated', this._updatePanel.bind(this));
this._delegate = this;
- this.container = new St.Bin({ child: this });
+ this.container = new St.Bin({child: this});
this.connect('style-changed', this._onStyleChanged.bind(this));
this.connect('destroy', this._onDestroy.bind(this));
});
export const Button = GObject.registerClass({
- Signals: { 'menu-set': {} },
+ Signals: {'menu-set': {}},
}, class PanelMenuButton extends ButtonBox {
_init(menuAlignment, nameText, dontCreateMenu) {
super._init({
get indicators() {
let klass = this.constructor.name;
- let { stack } = new Error();
+ let {stack} = new Error();
log(`Usage of indicator.indicators is deprecated for ${klass}\n${stack}`);
return this;
}
}
_addIndicator() {
- let icon = new St.Icon({ style_class: 'system-status-icon' });
+ let icon = new St.Icon({style_class: 'system-status-icon'});
this.add_actor(icon);
icon.connect('notify::visible', this._syncIndicatorsVisible.bind(this));
this._syncIndicatorsVisible();
true),
},
Signals: {
- 'activate': { param_types: [Clutter.Event.$gtype] },
+ 'activate': {param_types: [Clutter.Event.$gtype]},
},
}, class PopupBaseMenuItem extends St.BoxLayout {
_init(params) {
can_focus: false,
});
- this.label = new St.Label({ text: text || '' });
+ this.label = new St.Label({text: text || ''});
this.add(this.label);
this.label_actor = this.label;
});
export const PopupSwitchMenuItem = GObject.registerClass({
- Signals: { 'toggled': { param_types: [GObject.TYPE_BOOLEAN] } },
+ Signals: {'toggled': {param_types: [GObject.TYPE_BOOLEAN]}},
}, class PopupSwitchMenuItem extends PopupBaseMenuItem {
_init(text, active, params) {
super._init(params);
_connectItemSignals(menuItem) {
menuItem.connectObject(
'notify::active', () => {
- const { active } = menuItem;
+ const {active} = menuItem;
if (active && this._activeMenuItem !== menuItem) {
if (this._activeMenuItem)
this._activeMenuItem.active = false;
}
},
'notify::sensitive', () => {
- const { sensitive } = menuItem;
+ const {sensitive} = menuItem;
if (!sensitive && this._activeMenuItem === menuItem) {
if (!this.actor.navigate_focus(menuItem.actor,
St.DirectionType.TAB_FORWARD, true))
this.add_style_class_name('popup-submenu-menu-item');
if (wantIcon) {
- this.icon = new St.Icon({ style_class: 'popup-menu-icon' });
+ this.icon = new St.Icon({style_class: 'popup-menu-icon'});
this.add_child(this.icon);
}
this.add_child(expander);
this._triangle = arrowIcon(St.Side.RIGHT);
- this._triangle.pivot_point = new Graphene.Point({ x: 0.5, y: 0.6 });
+ this._triangle.pivot_point = new Graphene.Point({x: 0.5, y: 0.6});
this._triangleBin = new St.Widget({
y_expand: true,
export class PopupMenuManager {
constructor(owner, grabParams) {
this._grabParams = Params.parse(grabParams,
- { actionMode: Shell.ActionMode.POPUP });
+ {actionMode: Shell.ActionMode.POPUP});
global.stage.connect('notify::key-focus', () => {
if (!this.activeMenu)
return;
}
if (gicon)
- icon = new St.Icon({ gicon, icon_size: size });
+ icon = new St.Icon({gicon, icon_size: size});
return icon;
}
destroyOnClose: false,
});
- this._lockdownSettings = new Gio.Settings({ schema_id: LOCKDOWN_SCHEMA });
- this._terminalSettings = new Gio.Settings({ schema_id: TERMINAL_SCHEMA });
+ this._lockdownSettings = new Gio.Settings({schema_id: LOCKDOWN_SCHEMA});
+ this._terminalSettings = new Gio.Settings({schema_id: TERMINAL_SCHEMA});
global.settings.connect('changed::development-tools', () => {
this._enableInternalCommands = global.settings.get_boolean('development-tools');
});
let title = _('Run a Command');
- let content = new Dialog.MessageDialogContent({ title });
+ let content = new Dialog.MessageDialogContent({title});
this.contentLayout.add_actor(content);
let entry = new St.Entry({
y_expand: true,
reactive: true,
can_focus: true,
- pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }),
+ pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
name: 'lockDialogGroup',
});
this._loginSession = null;
this._getLoginSession();
- this._settings = new Gio.Settings({ schema_id: SCREENSAVER_SCHEMA });
+ this._settings = new Gio.Settings({schema_id: SCREENSAVER_SCHEMA});
this._settings.connect(`changed::${LOCK_ENABLED_KEY}`, this._syncInhibitor.bind(this));
- this._lockSettings = new Gio.Settings({ schema_id: LOCKDOWN_SCHEMA });
+ this._lockSettings = new Gio.Settings({schema_id: LOCKDOWN_SCHEMA});
this._lockSettings.connect(`changed::${DISABLE_LOCK_KEY}`, this._syncInhibitor.bind(this));
this._isModal = false;
if (this._isModal)
return true;
- let grab = Main.pushModal(Main.uiGroup, { actionMode: Shell.ActionMode.LOCK_SCREEN });
+ let grab = Main.pushModal(Main.uiGroup, {actionMode: Shell.ActionMode.LOCK_SCREEN});
// We expect at least a keyboard grab here
this._isModal = (grab.get_seat_state() & Clutter.GrabState.KEYBOARD) !== 0;
duration: Overview.ANIMATION_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete: () => {
- this._lockScreenShown({ fadeToBlack, animateFade: true });
+ this._lockScreenShown({fadeToBlack, animateFade: true});
},
});
} else {
this._lockDialogGroup.translation_y = 0;
- this._lockScreenShown({ fadeToBlack, animateFade: false });
+ this._lockScreenShown({fadeToBlack, animateFade: false});
}
this._dialog.grab_key_focus();
_init(params) {
super._init(params);
- this._topRect = new St.Widget({ style_class: 'screenshot-ui-area-indicator-shade' });
+ this._topRect = new St.Widget({style_class: 'screenshot-ui-area-indicator-shade'});
this._topRect.add_constraint(new Clutter.BindConstraint({
source: this,
coordinate: Clutter.BindCoordinate.WIDTH,
}));
this.add_child(this._topRect);
- this._bottomRect = new St.Widget({ style_class: 'screenshot-ui-area-indicator-shade' });
+ this._bottomRect = new St.Widget({style_class: 'screenshot-ui-area-indicator-shade'});
this._bottomRect.add_constraint(new Clutter.BindConstraint({
source: this,
coordinate: Clutter.BindCoordinate.WIDTH,
}));
this.add_child(this._bottomRect);
- this._leftRect = new St.Widget({ style_class: 'screenshot-ui-area-indicator-shade' });
+ this._leftRect = new St.Widget({style_class: 'screenshot-ui-area-indicator-shade'});
this._leftRect.add_constraint(new Clutter.SnapConstraint({
source: this,
from_edge: Clutter.SnapEdge.LEFT,
}));
this.add_child(this._leftRect);
- this._rightRect = new St.Widget({ style_class: 'screenshot-ui-area-indicator-shade' });
+ this._rightRect = new St.Widget({style_class: 'screenshot-ui-area-indicator-shade'});
this._rightRect.add_constraint(new Clutter.SnapConstraint({
source: this,
from_edge: Clutter.SnapEdge.RIGHT,
}));
this.add_child(this._rightRect);
- this._selectionRect = new St.Widget({ style_class: 'screenshot-ui-area-indicator-selection' });
+ this._selectionRect = new St.Widget({style_class: 'screenshot-ui-area-indicator-selection'});
this.add_child(this._selectionRect);
this._topRect.add_constraint(new Clutter.SnapConstraint({
});
const UIAreaSelector = GObject.registerClass({
- Signals: { 'drag-started': {}, 'drag-ended': {} },
+ Signals: {'drag-started': {}, 'drag-ended': {}},
}, class UIAreaSelector extends St.Widget {
_init(params) {
super._init(params);
}));
this.add_child(this._areaIndicator);
- this._topLeftHandle = new St.Widget({ style_class: 'screenshot-ui-area-selector-handle' });
+ this._topLeftHandle = new St.Widget({style_class: 'screenshot-ui-area-selector-handle'});
this.add_child(this._topLeftHandle);
- this._topRightHandle = new St.Widget({ style_class: 'screenshot-ui-area-selector-handle' });
+ this._topRightHandle = new St.Widget({style_class: 'screenshot-ui-area-selector-handle'});
this.add_child(this._topRightHandle);
- this._bottomLeftHandle = new St.Widget({ style_class: 'screenshot-ui-area-selector-handle' });
+ this._bottomLeftHandle = new St.Widget({style_class: 'screenshot-ui-area-selector-handle'});
this.add_child(this._bottomLeftHandle);
- this._bottomRightHandle = new St.Widget({ style_class: 'screenshot-ui-area-selector-handle' });
+ this._bottomRightHandle = new St.Widget({style_class: 'screenshot-ui-area-selector-handle'});
this.add_child(this._bottomRightHandle);
// This will be updated before the first drawn frame.
});
this.add_child(this._actor);
- this._border = new St.Bin({ style_class: 'screenshot-ui-window-selector-window-border' });
+ this._border = new St.Bin({style_class: 'screenshot-ui-window-selector-window-border'});
this._border.connect('style-changed', () => {
this._borderSize =
this._border.get_theme_node().get_border_width(St.Side.TOP);
});
this._cursor = null;
- this._cursorPoint = { x: 0, y: 0 };
+ this._cursorPoint = {x: 0, y: 0};
this._shouldShowCursor = window.has_pointer && window.has_pointer();
this.connect('destroy', this._onDestroy.bind(this));
this._screencastFailed();
});
- this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' });
+ this._lockdownSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.lockdown'});
// The full-screen screenshot has a separate container so that we can
// show it without the screenshot UI fade-in for a nicer animation.
- this._stageScreenshotContainer = new St.Widget({ visible: false });
+ this._stageScreenshotContainer = new St.Widget({visible: false});
this._stageScreenshotContainer.add_constraint(new Clutter.BindConstraint({
source: global.stage,
coordinate: Clutter.BindCoordinate.ALL,
Main.layoutManager.screenshotUIGroup.add_child(this);
- this._stageScreenshot = new St.Widget({ style_class: 'screenshot-ui-screen-screenshot' });
+ this._stageScreenshot = new St.Widget({style_class: 'screenshot-ui-screen-screenshot'});
this._stageScreenshot.add_constraint(new Clutter.BindConstraint({
source: global.stage,
coordinate: Clutter.BindCoordinate.ALL,
});
this.add_child(this._areaSelector);
- this._primaryMonitorBin = new St.Widget({ layout_manager: new Clutter.BinLayout() });
+ this._primaryMonitorBin = new St.Widget({layout_manager: new Clutter.BinLayout()});
this._primaryMonitorBin.add_constraint(
- new Layout.MonitorConstraint({ 'primary': true }));
+ new Layout.MonitorConstraint({'primary': true}));
this.add_child(this._primaryMonitorBin);
this._panel = new St.BoxLayout({
this._closeButton.add_constraint(new Clutter.AlignConstraint({
source: this._panel,
align_axis: Clutter.AlignAxis.Y_AXIS,
- pivot_point: new Graphene.Point({ x: -1, y: 0.5 }),
+ pivot_point: new Graphene.Point({x: -1, y: 0.5}),
factor: 0,
}));
this._closeButtonXAlignConstraint = new Clutter.AlignConstraint({
source: this._panel,
align_axis: Clutter.AlignAxis.X_AXIS,
- pivot_point: new Graphene.Point({ x: 0.5, y: -1 }),
+ pivot_point: new Graphene.Point({x: 0.5, y: -1}),
});
this._closeButton.add_constraint(this._closeButtonXAlignConstraint);
this._closeButton.connect('clicked', () => this.close());
visible: false,
}));
- this._bottomRowContainer = new St.Widget({ layout_manager: new Clutter.BinLayout() });
+ this._bottomRowContainer = new St.Widget({layout_manager: new Clutter.BinLayout()});
this._panel.add_child(this._bottomRowContainer);
this._shotCastContainer = new St.BoxLayout({
Main.wm.addKeybinding(
'show-screenshot-ui',
- new Gio.Settings({ schema_id: 'org.gnome.shell.keybindings' }),
+ new Gio.Settings({schema_id: 'org.gnome.shell.keybindings'}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
uiModes,
showScreenshotUI
Main.wm.addKeybinding(
'show-screen-recording-ui',
- new Gio.Settings({ schema_id: 'org.gnome.shell.keybindings' }),
+ new Gio.Settings({schema_id: 'org.gnome.shell.keybindings'}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
restrictedModes,
showScreenRecordingUI
Main.wm.addKeybinding(
'screenshot-window',
- new Gio.Settings({ schema_id: 'org.gnome.shell.keybindings' }),
+ new Gio.Settings({schema_id: 'org.gnome.shell.keybindings'}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT | Meta.KeyBindingFlags.PER_WINDOW,
restrictedModes,
async (_display, window, _binding) => {
Main.wm.addKeybinding(
'screenshot',
- new Gio.Settings({ schema_id: 'org.gnome.shell.keybindings' }),
+ new Gio.Settings({schema_id: 'org.gnome.shell.keybindings'}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
uiModes,
async () => {
const bin = new St.Widget({
layout_manager: new Clutter.BinLayout(),
});
- bin.add_constraint(new Layout.MonitorConstraint({ 'index': i }));
+ bin.add_constraint(new Layout.MonitorConstraint({'index': i}));
this.insert_child_below(bin, this._primaryMonitorBin);
this._monitorBins.push(bin);
// pop their grabs.
Main.layoutManager.emit('system-modal-opened');
- const { screenshotUIGroup } = Main.layoutManager;
+ const {screenshotUIGroup} = Main.layoutManager;
screenshotUIGroup.get_parent().set_child_above_sibling(
screenshotUIGroup, null);
}
const lockdownSettings =
- new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' });
+ new Gio.Settings({schema_id: 'org.gnome.desktop.lockdown'});
const disableSaveToDisk =
lockdownSettings.get_boolean('disable-save-to-disk');
_('Screenshot captured'),
// Translators: notification body when a screenshot was captured.
_('You can paste the image from the clipboard.'),
- { datetime: time, gicon: content }
+ {datetime: time, gicon: content}
);
if (!disableSaveToDisk) {
const stream = Gio.MemoryOutputStream.new_resizable();
const [x, y, w, h] = geometry ?? [0, 0, -1, -1];
if (cursor === null)
- cursor = { texture: null, x: 0, y: 0, scale: 1 };
+ cursor = {texture: null, x: 0, y: 0, scale: 1};
global.display.get_sound_player().play_from_theme(
'screen-capture', _('Screenshot taken'), null);
'org.gnome.Screenshot',
]);
- this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' });
+ this._lockdownSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.lockdown'});
Gio.DBus.session.own_name('org.gnome.Shell.Screenshot', Gio.BusNameOwnerFlags.REPLACE, null, null);
}
'Invalid params');
return;
}
- let flashspot = new Flashspot({ x, y, width, height });
+ let flashspot = new Flashspot({x, y, width, height});
flashspot.fire();
invocation.return_value(null);
}
const pickPixel = new PickPixel(screenshot);
try {
const color = await pickPixel.pickAsync();
- const { red, green, blue } = color;
+ const {red, green, blue} = color;
const retval = GLib.Variant.new('(a{sv})', [{
color: GLib.Variant.new('(ddd)', [
red / 255.0,
this.show();
try {
- await this._grabHelper.grabAsync({ actor: this });
+ await this._grabHelper.grabAsync({actor: this});
} finally {
global.display.set_cursor(Meta.Cursor.DEFAULT);
export const PickPixel = GObject.registerClass(
class PickPixel extends St.Widget {
_init(screenshot) {
- super._init({ visible: false, reactive: true });
+ super._init({visible: false, reactive: true});
this._screenshot = screenshot;
this._pickColor(...global.get_pointer());
try {
- await this._grabHelper.grabAsync({ actor: this });
+ await this._grabHelper.grabAsync({actor: this});
} finally {
global.display.set_cursor(Meta.Cursor.DEFAULT);
this._previewCursor.destroy();
}
fire(doneCallback) {
- this.set({ visible: true, opacity: 255 });
+ this.set({visible: true, opacity: 255});
this.ease({
opacity: 0,
duration: FLASHSPOT_ANIMATION_OUT_TIME,
this.style_class = 'grid-search-result';
this.icon = new IconGrid.BaseIcon(this.metaInfo['name'],
- { createIcon: this.metaInfo['createIcon'] });
+ {createIcon: this.metaInfo['createIcon']});
let content = new St.Bin({
child: this.icon,
x_align: Clutter.ActorAlign.START,
},
}, class SearchResultsBase extends St.BoxLayout {
_init(provider, resultsView) {
- super._init({ style_class: 'search-section', vertical: true });
+ super._init({style_class: 'search-section', vertical: true});
this.provider = provider;
this._resultsView = resultsView;
this._resultDisplayBin = new St.Bin();
this.add_child(this._resultDisplayBin);
- let separator = new St.Widget({ style_class: 'search-section-separator' });
+ let separator = new St.Widget({style_class: 'search-section-separator'});
this.add(separator);
this._resultDisplays = {};
_init(provider, resultsView) {
super._init(provider, resultsView);
- this._container = new St.BoxLayout({ style_class: 'search-section-content' });
+ this._container = new St.BoxLayout({style_class: 'search-section-content'});
this.providerInfo = new ProviderInfo(provider);
this.providerInfo.connect('key-focus-in', this._keyFocusIn.bind(this));
this.providerInfo.connect('clicked', () => {
_init(provider, resultsView) {
super._init(provider, resultsView);
- this._grid = new St.Widget({ style_class: 'grid-search-results' });
+ this._grid = new St.Widget({style_class: 'grid-search-results'});
this._grid.layout_manager = new GridSearchResultsLayout();
this._grid.connect('style-changed', () => {
this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
this._scrollView.add_actor(this._content);
- let action = new Clutter.PanAction({ interpolate: true });
+ let action = new Clutter.PanAction({interpolate: true});
action.connect('pan', this._onPan.bind(this));
this._scrollView.add_action(action);
x_align: Clutter.ActorAlign.CENTER,
y_align: Clutter.ActorAlign.CENTER,
});
- this._statusBin = new St.Bin({ y_expand: true });
+ this._statusBin = new St.Bin({y_expand: true});
this.add_child(this._statusBin);
this._statusBin.add_actor(this._statusText);
this._highlighter = new Highlighter();
- this._searchSettings = new Gio.Settings({ schema_id: SEARCH_PROVIDERS_SCHEMA });
+ this._searchSettings = new Gio.Settings({schema_id: SEARCH_PROVIDERS_SCHEMA});
this._searchSettings.connect('changed::disabled', this._reloadRemoteProviders.bind(this));
this._searchSettings.connect('changed::enabled', this._reloadRemoteProviders.bind(this));
this._searchSettings.connect('changed::disable-external', this._reloadRemoteProviders.bind(this));
x_align: Clutter.ActorAlign.START,
});
- this._moreLabel = new St.Label({ x_align: Clutter.ActorAlign.START });
+ this._moreLabel = new St.Label({x_align: Clutter.ActorAlign.START});
detailsBox.add_actor(nameLabel);
detailsBox.add_actor(this._moreLabel);
// Since the entry isn't inside the results container we install this
// dummy widget as the last results container child so that we can
// include the entry in the keynav tab path
- this._focusTrap = new FocusTrap({ can_focus: true });
+ this._focusTrap = new FocusTrap({can_focus: true});
this._focusTrap.connect('key-focus-in', () => {
this._entry.grab_key_focus();
});
if (entry.menu)
return;
- params = Params.parse(params, { actionMode: Shell.ActionMode.POPUP });
+ params = Params.parse(params, {actionMode: Shell.ActionMode.POPUP});
entry.menu = new EntryMenu(entry);
entry._menuManager = new PopupMenu.PopupMenuManager(entry,
- { actionMode: params.actionMode });
+ {actionMode: params.actionMode});
entry._menuManager.addMenu(entry.menu);
// Add an event handler to both the entry and its clutter_text; the former
export const CapsLockWarning = GObject.registerClass(
class CapsLockWarning extends St.Label {
_init(params) {
- let defaultParams = { style_class: 'caps-lock-warning-label' };
+ let defaultParams = {style_class: 'caps-lock-warning-label'};
super._init(Object.assign(defaultParams, params));
this.text = _('Caps lock is on.');
this.remove_all_transitions();
- const { naturalHeightSet } = this;
+ const {naturalHeightSet} = this;
this.natural_height_set = false;
let [, height] = this.get_preferred_height(-1);
this.natural_height_set = naturalHeightSet;
export class ShellMountOperation {
constructor(source, params) {
- params = Params.parse(params, { existingDialog: null });
+ params = Params.parse(params, {existingDialog: null});
this._dialog = null;
this._existingDialog = params.existingDialog;
});
const ShellMountQuestionDialog = GObject.registerClass({
- Signals: { 'response': { param_types: [GObject.TYPE_INT] } },
+ Signals: {'response': {param_types: [GObject.TYPE_INT]}},
}, class ShellMountQuestionDialog extends ModalDialog.ModalDialog {
_init() {
- super._init({ styleClass: 'mount-question-dialog' });
+ super._init({styleClass: 'mount-question-dialog'});
this._oldChoices = [];
let strings = message.split('\n');
let title = strings.shift() || null;
let description = strings.shift() || null;
- super._init({ styleClass: 'prompt-dialog' });
+ super._init({styleClass: 'prompt-dialog'});
let disksApp = Shell.AppSystem.get_default().lookup_app('org.gnome.DiskUtility.desktop');
- let content = new Dialog.MessageDialogContent({ title, description });
+ let content = new Dialog.MessageDialogContent({title, description});
- let passwordGridLayout = new Clutter.GridLayout({ orientation: Clutter.Orientation.VERTICAL });
+ let passwordGridLayout = new Clutter.GridLayout({orientation: Clutter.Orientation.VERTICAL});
let passwordGrid = new St.Widget({
style_class: 'prompt-dialog-password-grid',
layout_manager: passwordGridLayout,
}
curGridRow += 1;
- let warningBox = new St.BoxLayout({ vertical: true });
+ let warningBox = new St.BoxLayout({vertical: true});
let capsLockWarning = new ShellEntry.CapsLockWarning();
warningBox.add_child(capsLockWarning);
});
const ShellProcessesDialog = GObject.registerClass({
- Signals: { 'response': { param_types: [GObject.TYPE_INT] } },
+ Signals: {'response': {param_types: [GObject.TYPE_INT]}},
}, class ShellProcessesDialog extends ModalDialog.ModalDialog {
_init() {
- super._init({ styleClass: 'processes-dialog' });
+ super._init({styleClass: 'processes-dialog'});
this._oldChoices = [];
icon_name: 'org.gnome.Settings-accessibility-symbolic',
}));
- this._a11ySettings = new Gio.Settings({ schema_id: A11Y_SCHEMA });
+ this._a11ySettings = new Gio.Settings({schema_id: A11Y_SCHEMA});
this._a11ySettings.connect(`changed::${KEY_ALWAYS_SHOW}`, this._queueSyncMenuVisibility.bind(this));
let highContrast = this._buildItem(_('High Contrast'), A11Y_INTERFACE_SCHEMA, KEY_HIGH_CONTRAST);
}
_buildItem(string, schema, key) {
- let settings = new Gio.Settings({ schema_id: schema });
+ let settings = new Gio.Settings({schema_id: schema});
let widget = this._buildItemExtended(string,
settings.get_boolean(key),
settings.is_writable(key),
}
_buildFontItem() {
- let settings = new Gio.Settings({ schema_id: DESKTOP_INTERFACE_SCHEMA });
+ let settings = new Gio.Settings({schema_id: DESKTOP_INTERFACE_SCHEMA});
let factor = settings.get_double(KEY_TEXT_SCALING_FACTOR);
let initialSetting = factor > 1.0;
let widget = this._buildItemExtended(_('Large Text'),
});
this.add_child(this._icon);
- this._a11ySettings = new Gio.Settings({ schema_id: MOUSE_A11Y_SCHEMA });
+ this._a11ySettings = new Gio.Settings({schema_id: MOUSE_A11Y_SCHEMA});
this._a11ySettings.connect(`changed::${KEY_DWELL_CLICK_ENABLED}`, this._syncMenuVisibility.bind(this));
this._a11ySettings.connect(`changed::${KEY_DWELL_MODE}`, this._syncMenuVisibility.bind(this));
text: displayName,
x_expand: true,
});
- this.indicator = new St.Label({ text: shortName });
+ this.indicator = new St.Label({text: shortName});
this.add_child(this.label);
this.add(this.indicator);
this.label_actor = this.label;
}
_addIcon(item) {
- let box = new St.BoxLayout({ vertical: true });
+ let box = new St.BoxLayout({vertical: true});
- let bin = new St.Bin({ style_class: 'input-source-switcher-symbol' });
+ let bin = new St.Bin({style_class: 'input-source-switcher-symbol'});
let symbol = new St.Label({
text: item.shortName,
x_align: Clutter.ActorAlign.CENTER,
let id = layouts[i];
if (variants[i])
id += `+${variants[i]}`;
- sourcesList.push({ type: INPUT_SOURCE_TYPE_XKB, id });
+ sourcesList.push({type: INPUT_SOURCE_TYPE_XKB, id});
}
return sourcesList;
}
this._KEY_KEYBOARD_OPTIONS = 'xkb-options';
this._KEY_PER_WINDOW = 'per-window';
- this._settings = new Gio.Settings({ schema_id: this._DESKTOP_INPUT_SOURCES_SCHEMA });
+ this._settings = new Gio.Settings({schema_id: this._DESKTOP_INPUT_SOURCES_SCHEMA});
this._settings.connect(`changed::${this._KEY_INPUT_SOURCES}`, this._emitInputSourcesChanged.bind(this));
this._settings.connect(`changed::${this._KEY_KEYBOARD_OPTIONS}`, this._emitKeyboardOptionsChanged.bind(this));
this._settings.connect(`changed::${this._KEY_PER_WINDOW}`, this._emitPerWindowChanged.bind(this));
for (let i = 0; i < nSources; i++) {
let [type, id] = sources.get_child_value(i).deepUnpack();
- sourcesList.push({ type, id });
+ sourcesList.push({type, id});
}
return sourcesList;
}
this._mruSourcesBackup = null;
this._keybindingAction =
Main.wm.addKeybinding('switch-input-source',
- new Gio.Settings({ schema_id: 'org.gnome.desktop.wm.keybindings' }),
+ new Gio.Settings({schema_id: 'org.gnome.desktop.wm.keybindings'}),
Meta.KeyBindingFlags.NONE,
Shell.ActionMode.ALL,
this._switchInputSource.bind(this));
this._keybindingActionBackward =
Main.wm.addKeybinding('switch-input-source-backward',
- new Gio.Settings({ schema_id: 'org.gnome.desktop.wm.keybindings' }),
+ new Gio.Settings({schema_id: 'org.gnome.desktop.wm.keybindings'}),
Meta.KeyBindingFlags.IS_REVERSED,
Shell.ActionMode.ALL,
this._switchInputSource.bind(this));
}
if (exists)
- infosList.push({ type, id, displayName, shortName });
+ infosList.push({type, id, displayName, shortName});
}
if (infosList.length == 0) {
let type = INPUT_SOURCE_TYPE_XKB;
let id = KeyboardManager.DEFAULT_LAYOUT;
let [, displayName, shortName] = this._xkbInfo.get_layout_info(id);
- infosList.push({ type, id, displayName, shortName });
+ infosList.push({type, id, displayName, shortName});
}
let inputSourcesByShortName = {};
this._menuItems = {};
this._indicatorLabels = {};
- this._container = new InputSourceIndicatorContainer({ style_class: 'system-status-icon' });
+ this._container = new InputSourceIndicatorContainer({style_class: 'system-status-icon'});
this.add_child(this._container);
this._propSeparator = new PopupMenu.PopupSeparatorMenuItem();
_init() {
super._init();
- this._settings = new Gio.Settings({ schema_id: LOCATION_SCHEMA });
+ this._settings = new Gio.Settings({schema_id: LOCATION_SCHEMA});
this._settings.connectObject(
`changed::${ENABLED}`, () => this.notify('enabled'),
`changed::${MAX_ACCURACY_LEVEL}`, () => this._onMaxAccuracyLevelChanged(),
}
export const GeolocationDialog = GObject.registerClass({
- Signals: { 'response': { param_types: [GObject.TYPE_UINT] } },
+ Signals: {'response': {param_types: [GObject.TYPE_UINT]}},
}, class GeolocationDialog extends ModalDialog.ModalDialog {
_init(name, reason, reqAccuracyLevel) {
- super._init({ styleClass: 'geolocation-dialog' });
+ super._init({styleClass: 'geolocation-dialog'});
this.reqAccuracyLevel = reqAccuracyLevel;
let content = new Dialog.MessageDialogContent({
});
export const ScreenRecordingIndicator = GObject.registerClass({
- Signals: { 'menu-set': {} },
+ Signals: {'menu-set': {}},
}, class ScreenRecordingIndicator extends PanelMenu.ButtonBox {
_init() {
super._init({
if (_mixerControl)
return _mixerControl;
- _mixerControl = new Gvc.MixerControl({ name: 'GNOME Shell Volume Control' });
+ _mixerControl = new Gvc.MixerControl({name: 'GNOME Shell Volume Control'});
_mixerControl.open();
return _mixerControl;
append(time, delta) {
this.trim(time);
- this._data.push({ time, delta });
+ this._data.push({time, delta});
}
calculateVelocity() {
Clutter.Orientation, Clutter.Orientation.HORIZONTAL),
},
Signals: {
- 'begin': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] },
- 'update': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] },
- 'end': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE] },
+ 'begin': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE]},
+ 'update': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE]},
+ 'end': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE]},
},
}, class TouchpadSwipeGesture extends GObject.Object {
_init(allowedModes) {
Clutter.Orientation, Clutter.Orientation.HORIZONTAL),
},
Signals: {
- 'begin': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] },
- 'update': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] },
- 'end': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE] },
- 'cancel': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE] },
+ 'begin': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE]},
+ 'update': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE]},
+ 'end': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE]},
+ 'cancel': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE]},
},
}, class TouchSwipeGesture extends Clutter.GestureAction {
_init(allowedModes, nTouchPoints, thresholdTriggerEdge) {
Clutter.ModifierType, 0),
},
Signals: {
- 'begin': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] },
- 'update': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] },
- 'end': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE] },
+ 'begin': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE]},
+ 'update': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE]},
+ 'end': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE]},
},
}, class ScrollGesture extends GObject.Object {
_init(actor, allowedModes) {
Clutter.ModifierType, 0),
},
Signals: {
- 'begin': { param_types: [GObject.TYPE_UINT] },
- 'update': { param_types: [GObject.TYPE_DOUBLE] },
- 'end': { param_types: [GObject.TYPE_UINT64, GObject.TYPE_DOUBLE] },
+ 'begin': {param_types: [GObject.TYPE_UINT]},
+ 'update': {param_types: [GObject.TYPE_DOUBLE]},
+ 'end': {param_types: [GObject.TYPE_UINT64, GObject.TYPE_DOUBLE]},
},
}, class SwipeTracker extends GObject.Object {
_init(actor, orientation, allowedModes, params) {
super._init();
- params = Params.parse(params, { allowDrag: true, allowScroll: true });
+ params = Params.parse(params, {allowDrag: true, allowScroll: true});
this.orientation = orientation;
this._allowedModes = allowedModes;
this._history.append(time, 0);
- let rect = new Meta.Rectangle({ x, y, width: 1, height: 1 });
+ let rect = new Meta.Rectangle({x, y, width: 1, height: 1});
let monitor = global.display.get_monitor_index_for_rect(rect);
this.emit('begin', monitor);
export const SwitcherList = GObject.registerClass({
Signals: {
- 'item-activated': { param_types: [GObject.TYPE_INT] },
- 'item-entered': { param_types: [GObject.TYPE_INT] },
- 'item-removed': { param_types: [GObject.TYPE_INT] },
+ 'item-activated': {param_types: [GObject.TYPE_INT]},
+ 'item-entered': {param_types: [GObject.TYPE_INT]},
+ 'item-removed': {param_types: [GObject.TYPE_INT]},
},
}, class SwitcherList extends St.Widget {
_init(squareItems) {
- super._init({ style_class: 'switcher-list' });
+ super._init({style_class: 'switcher-list'});
this._list = new St.BoxLayout({
style_class: 'switcher-list-item-container',
const SUMMARY_ICON_SIZE = 32;
const NotificationsBox = GObject.registerClass({
- Signals: { 'wake-up-screen': {} },
+ Signals: {'wake-up-screen': {}},
}, class NotificationsBox extends St.BoxLayout {
_init() {
super._init({
name: 'unlockDialogNotifications',
});
- this._scrollView = new St.ScrollView({ hscrollbar_policy: St.PolicyType.NEVER });
+ this._scrollView = new St.ScrollView({hscrollbar_policy: St.PolicyType.NEVER});
this._notificationBox = new St.BoxLayout({
vertical: true,
style_class: 'unlock-dialog-notifications-container',
_makeNotificationDetailedSource(source, box) {
let sourceActor = new MessageTray.SourceActor(source, SUMMARY_ICON_SIZE);
- let sourceBin = new St.Bin({ child: sourceActor });
+ let sourceBin = new St.Bin({child: sourceActor});
box.add(sourceBin);
- let textBox = new St.BoxLayout({ vertical: true });
+ let textBox = new St.BoxLayout({vertical: true});
box.add_child(textBox);
let title = new St.Label({
: GLib.markup_escape_text(bodyText, -1);
}
- let label = new St.Label({ style_class: 'unlock-dialog-notification-count-text' });
+ let label = new St.Label({style_class: 'unlock-dialog-notification-count-text'});
label.clutter_text.set_markup(`<b>${n.title}</b> ${body}`);
textBox.add(label);
const Clock = GObject.registerClass(
class UnlockDialogClock extends St.BoxLayout {
_init() {
- super._init({ style_class: 'unlock-dialog-clock', vertical: true });
+ super._init({style_class: 'unlock-dialog-clock', vertical: true});
this._time = new St.Label({
style_class: 'unlock-dialog-clock-time',
this.add_child(this._date);
this.add_child(this._hint);
- this._wallClock = new GnomeDesktop.WallClock({ time_only: true });
+ this._wallClock = new GnomeDesktop.WallClock({time_only: true});
this._wallClock.connect('notify::clock', this._updateClock.bind(this));
this._seat = Clutter.get_default_backend().get_default_seat();
// Authentication & Clock stack
this._stack = new Shell.Stack();
- this._promptBox = new St.BoxLayout({ vertical: true });
+ this._promptBox = new St.BoxLayout({vertical: true});
this._promptBox.set_pivot_point(0.5, 0.5);
this._promptBox.hide();
this._stack.add_child(this._promptBox);
this._otherUserButton.set_pivot_point(0.5, 0.5);
this._otherUserButton.connect('clicked', this._otherUserClicked.bind(this));
- this._screenSaverSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.screensaver' });
+ this._screenSaverSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.screensaver'});
this._screenSaverSettings.connectObject('changed::user-switch-enabled',
this._updateUserSwitchVisibility.bind(this), this);
- this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' });
+ this._lockdownSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.lockdown'});
this._lockdownSettings.connect('changed::disable-user-switching',
this._updateUserSwitchVisibility.bind(this));
// Main Box
let mainBox = new St.Widget();
- mainBox.add_constraint(new Layout.MonitorConstraint({ primary: true }));
+ mainBox.add_constraint(new Layout.MonitorConstraint({primary: true}));
mainBox.add_child(this._stack);
mainBox.add_child(this._notificationsBox);
mainBox.add_child(this._otherUserButton);
y: monitor.y,
width: monitor.width,
height: monitor.height,
- effect: new Shell.BlurEffect({ name: 'blur' }),
+ effect: new Shell.BlurEffect({name: 'blur'}),
});
let bgManager = new Background.BackgroundManager({
can_focus: progress > 0,
});
- const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage);
+ const {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
this._promptBox.set({
opacity: 255 * progress,
userName = null;
}
- this._authPrompt.begin({ userName });
+ this._authPrompt.begin({userName});
}
_escape() {
iconFile = null;
}
- let { scaleFactor } = St.ThemeContext.get_for_stage(global.stage);
+ let {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
this.set_size(
this._iconSize * scaleFactor,
this._iconSize * scaleFactor);
export const UserWidgetLabel = GObject.registerClass(
class UserWidgetLabel extends St.Widget {
_init(user) {
- super._init({ layout_manager: new Clutter.BinLayout() });
+ super._init({layout_manager: new Clutter.BinLayout()});
this._user = user;
export const WelcomeDialog = GObject.registerClass(
class WelcomeDialog extends ModalDialog.ModalDialog {
_init() {
- super._init({ styleClass: 'welcome-dialog' });
+ super._init({styleClass: 'welcome-dialog'});
const appSystem = Shell.AppSystem.get_default();
this._tourAppInfo = appSystem.lookup_app('org.gnome.Tour.desktop');
const [majorVersion] = Config.PACKAGE_VERSION.split('.');
const title = _('Welcome to GNOME %s').format(majorVersion);
const description = _('If you want to learn your way around, check out the tour.');
- const content = new Dialog.MessageDialogContent({ title, description });
+ const content = new Dialog.MessageDialogContent({title, description});
- const icon = new St.Widget({ style_class: 'welcome-dialog-image' });
+ const icon = new St.Widget({style_class: 'welcome-dialog-image'});
content.insert_child_at_index(icon, 0);
this.contentLayout.add_child(content);
let title = _('Keep these display settings?');
let description = this._formatCountDown();
- this._content = new Dialog.MessageDialogContent({ title, description });
+ this._content = new Dialog.MessageDialogContent({title, description});
this.contentLayout.add_child(this._content);
/* Translators: this and the following message should be limited in length,
global.display.connect('window-left-monitor',
this._windowLeftMonitor.bind(this));
- this._workspaceSettings = new Gio.Settings({ schema_id: 'org.gnome.mutter' });
+ this._workspaceSettings = new Gio.Settings({schema_id: 'org.gnome.mutter'});
this._workspaceSettings.connect('changed::dynamic-workspaces', this._queueCheckWorkspaces.bind(this));
this._nWorkspacesChanged();
});
const AppSwitchAction = GObject.registerClass({
- Signals: { 'activated': {} },
+ Signals: {'activated': {}},
}, class AppSwitchAction extends Clutter.GestureAction {
_init() {
super._init();
const ResizePopup = GObject.registerClass(
class ResizePopup extends St.Widget {
_init() {
- super._init({ layout_manager: new Clutter.BinLayout() });
+ super._init({layout_manager: new Clutter.BinLayout()});
this._label = new St.Label({
style_class: 'resize-popup',
x_align: Clutter.ActorAlign.CENTER,
// Position a clone of the window on top of the old position,
// while actor updates are frozen.
let actorContent = actor.paint_to_content(oldFrameRect);
- let actorClone = new St.Widget({ content: actorContent });
+ let actorClone = new St.Widget({content: actorContent});
actorClone.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS);
actorClone.set_position(oldFrameRect.x, oldFrameRect.y);
actorClone.set_size(oldFrameRect.width, oldFrameRect.height);
constructor() {
this._manager = new PopupMenu.PopupMenuManager(Main.layoutManager.dummyCursor);
- this._sourceActor = new St.Widget({ reactive: true, visible: false });
+ this._sourceActor = new St.Widget({reactive: true, visible: false});
this._sourceActor.connect('button-press-event', () => {
this._manager.activeMenu.toggle();
});
'drag-begin': {},
'drag-cancelled': {},
'drag-end': {},
- 'selected': { param_types: [GObject.TYPE_UINT] },
+ 'selected': {param_types: [GObject.TYPE_UINT]},
'show-chrome': {},
'size-changed': {},
},
});
const windowContainer = new Clutter.Actor({
- pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }),
+ pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
});
this.window_container = windowContainer;
this._icon.add_style_class_name('icon-dropshadow');
this._icon.set({
reactive: true,
- pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }),
+ pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
});
this._icon.add_constraint(new Clutter.BindConstraint({
source: windowContainer,
this._icon.add_constraint(new Clutter.AlignConstraint({
source: windowContainer,
align_axis: Clutter.AlignAxis.Y_AXIS,
- pivot_point: new Graphene.Point({ x: -1, y: ICON_OVERLAP }),
+ pivot_point: new Graphene.Point({x: -1, y: ICON_OVERLAP}),
factor: 1,
}));
- const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage);
+ const {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
this._title = new St.Label({
visible: false,
style_class: 'window-caption',
this._title.add_constraint(new Clutter.AlignConstraint({
source: windowContainer,
align_axis: Clutter.AlignAxis.Y_AXIS,
- pivot_point: new Graphene.Point({ x: -1, y: 0 }),
+ pivot_point: new Graphene.Point({x: -1, y: 0}),
factor: 1,
}));
this._title.clutter_text.ellipsize = Pango.EllipsizeMode.END;
this._closeButton.add_constraint(new Clutter.AlignConstraint({
source: windowContainer,
align_axis: Clutter.AlignAxis.X_AXIS,
- pivot_point: new Graphene.Point({ x: 0.5, y: -1 }),
+ pivot_point: new Graphene.Point({x: 0.5, y: -1}),
factor: this._closeButtonSide === St.Side.LEFT ? 0 : 1,
}));
this._closeButton.add_constraint(new Clutter.AlignConstraint({
source: windowContainer,
align_axis: Clutter.AlignAxis.Y_AXIS,
- pivot_point: new Graphene.Point({ x: -1, y: 0.5 }),
+ pivot_point: new Graphene.Point({x: -1, y: 0.5}),
factor: 0,
}));
this._closeButton.connect('clicked', () => this._deleteAll());
}
_updateIconScale() {
- const { ControlsState } = OverviewControls;
- const { currentState, initialState, finalState } =
+ const {ControlsState} = OverviewControls;
+ const {currentState, initialState, finalState} =
this._overviewAdjustment.getStateTransitionParams();
const visible =
initialState === ControlsState.WINDOW_PICKER ||
chromeHeights() {
const [, closeButtonHeight] = this._closeButton.get_preferred_height(-1);
const [, iconHeight] = this._icon.get_preferred_height(-1);
- const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage);
+ const {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
const activeExtraSize = WINDOW_ACTIVE_SIZE_INC * scaleFactor;
const topOversize = closeButtonHeight / 2;
chromeWidths() {
const [, closeButtonWidth] = this._closeButton.get_preferred_width(-1);
- const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage);
+ const {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
const activeExtraSize = WINDOW_ACTIVE_SIZE_INC * scaleFactor;
const leftOversize = this._closeButtonSide === St.Side.LEFT
});
const [width, height] = this.window_container.get_size();
- const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage);
+ const {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
const activeExtraSize = WINDOW_ACTIVE_SIZE_INC * 2 * scaleFactor;
const origSize = Math.max(width, height);
const scale = (origSize + activeExtraSize) / origSize;
}
get boundingBox() {
- return { ...this._cachedBoundingBox };
+ return {...this._cachedBoundingBox};
}
get windowCenter() {
}
_computeRowSizes(layout) {
- let { rows, scale } = layout;
+ let {rows, scale} = layout;
for (let i = 0; i < rows.length; i++) {
let row = rows[i];
row.width = row.fullWidth * scale + (row.windows.length - 1) * this._columnSpacing;
computeWindowSlots(layout, area) {
this._computeRowSizes(layout);
- let { rows, scale } = layout;
+ let {rows, scale} = layout;
let slots = [];
}
_syncOpacities() {
- this._windows.forEach(({ metaWindow }, actor) => {
+ this._windows.forEach(({metaWindow}, actor) => {
this._syncOpacity(actor, metaWindow);
});
}
if (containerBox) {
const monitor = Main.layoutManager.monitors[this._monitorIndex];
- const bottomPoint = new Graphene.Point3D({ y: containerBox.y2 });
+ const bottomPoint = new Graphene.Point3D({y: containerBox.y2});
const transformedBottomPoint =
this._container.apply_transform_to_point(bottomPoint);
const bottomFreeSpace =
this.notify('layout-frozen');
}
- const { ControlsState } = OverviewControls;
- const { currentState } =
+ const {ControlsState} = OverviewControls;
+ const {currentState} =
this._overviewAdjustment.getStateTransitionParams();
const inSessionTransition = currentState <= ControlsState.WINDOW_PICKER;
}
_updateBorderRadius() {
- const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage);
+ const {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
const cornerRadius = scaleFactor * BACKGROUND_CORNER_RADIUS_PIXELS;
const backgroundContent = this._bgManager.backgroundActor.content;
_init(metaWorkspace, monitorIndex, overviewAdjustment) {
super._init({
style_class: 'window-picker',
- pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }),
+ pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
layout_manager: new Clutter.BinLayout(),
});
this.add_child(clone);
- const record = { windowActor, clone };
+ const record = {windowActor, clone};
windowActor.connectObject('destroy', () => {
clone.destroy();
this._monitor = monitor;
- const constraint = new Layout.MonitorConstraint({ index: monitor.index });
+ const constraint = new Layout.MonitorConstraint({index: monitor.index});
this.add_constraint(constraint);
this._container = new Clutter.Actor();
const swipeTracker = new SwipeTracker.SwipeTracker(global.stage,
Clutter.Orientation.HORIZONTAL,
Shell.ActionMode.NORMAL,
- { allowDrag: false });
+ {allowDrag: false});
swipeTracker.connect('begin', this._switchWorkspaceBegin.bind(this));
swipeTracker.connect('update', this._switchWorkspaceUpdate.bind(this));
swipeTracker.connect('end', this._switchWorkspaceEnd.bind(this));
y_align: Clutter.ActorAlign.END,
});
- const constraint = new Layout.MonitorConstraint({ primary: true });
+ const constraint = new Layout.MonitorConstraint({primary: true});
this.add_constraint(constraint);
Main.uiGroup.add_actor(this);
'drag-begin': {},
'drag-cancelled': {},
'drag-end': {},
- 'selected': { param_types: [GObject.TYPE_UINT] },
+ 'selected': {param_types: [GObject.TYPE_UINT]},
},
}, class WindowClone extends Clutter.Actor {
_init(realWindow) {
- let clone = new Clutter.Clone({ source: realWindow });
+ let clone = new Clutter.Clone({source: realWindow});
super._init({
layout_manager: new PrimaryActorLayout(clone),
reactive: true,
}
_doAddAttachedDialog(metaDialog, realDialog) {
- let clone = new Clutter.Clone({ source: realDialog });
+ let clone = new Clutter.Clone({source: realDialog});
this._updateDialogPosition(realDialog, clone);
realDialog.connectObject(
super._init({
clip_to_allocation: true,
style_class: 'workspace-thumbnail',
- pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }),
+ pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
});
this._delegate = this;
style_class: 'workspace-thumbnails',
reactive: true,
x_align: Clutter.ActorAlign.CENTER,
- pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }),
+ pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
});
this._delegate = this;
- let indicator = new St.Bin({ style_class: 'workspace-thumbnail-indicator' });
+ let indicator = new St.Bin({style_class: 'workspace-thumbnail-indicator'});
// We don't want the indicator to affect drag-and-drop
Shell.util_set_hidden_from_pick(indicator, true);
this._dropWorkspace = -1;
this._dropPlaceholderPos = -1;
- this._dropPlaceholder = new St.Bin({ style_class: 'placeholder' });
+ this._dropPlaceholder = new St.Bin({style_class: 'placeholder'});
this.add_actor(this._dropPlaceholder);
this._spliceIndex = -1;
'window-drag-end', () => this._onDragEnd(),
'window-drag-cancelled', () => this._onDragCancelled(), this);
- this._settings = new Gio.Settings({ schema_id: MUTTER_SCHEMA });
+ this._settings = new Gio.Settings({schema_id: MUTTER_SCHEMA});
this._settings.connect('changed::dynamic-workspaces',
() => this._updateShouldShow());
this._updateShouldShow();
}
_updateShouldShow() {
- const { nWorkspaces } = global.workspace_manager;
+ const {nWorkspaces} = global.workspace_manager;
const shouldShow = this._settings.get_boolean('dynamic-workspaces')
? nWorkspaces > NUM_WORKSPACES_THRESHOLD
: nWorkspaces > 1;
}
_updateIndicator() {
- const { value } = this._scrollAdjustment;
- const { workspaceManager } = global;
+ const {value} = this._scrollAdjustment;
+ const {workspaceManager} = global;
const activeIndex = workspaceManager.get_active_workspace_index();
this._animatingIndicator = value !== activeIndex;
if (this._thumbnails.length > 0)
return;
- const { workspaceManager } = global;
+ const {workspaceManager} = global;
this._transientSignalHolder = new TransientSignalHolder(this);
workspaceManager.connectObject(
'notify::n-workspaces', this._workspacesChanged.bind(this),
_updatePorthole() {
if (!Main.layoutManager.monitors[this._monitorIndex]) {
- const { x, y, width, height } = global.stage;
- this._porthole = { x, y, width, height };
+ const {x, y, width, height} = global.stage;
+ this._porthole = {x, y, width, height};
} else {
this._porthole =
Main.layoutManager.getWorkAreaForMonitor(this._monitorIndex);
}
_getFirstFitAllWorkspaceBox(box, spacing, vertical) {
- const { nWorkspaces } = global.workspaceManager;
+ const {nWorkspaces} = global.workspaceManager;
const [width, height] = box.get_size();
const [workspace] = this._workspaces;
x1 -= currentWorkspace * (workspaceWidth + spacing);
}
- const fitSingleBox = new Clutter.ActorBox({ x1, y1 });
+ const fitSingleBox = new Clutter.ActorBox({x1, y1});
if (vertical) {
const [, workspaceHeight] = workspace.get_preferred_height(width);
}
const spacing = (availableSpace - workspaceSize * 0.4) * (1 - fitMode);
- const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage);
+ const {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
return Math.clamp(spacing, WORKSPACE_MIN_SPACING * scaleFactor,
WORKSPACE_MAX_SPACING * scaleFactor);
}
_getWorkspaceModeForOverviewState(state) {
- const { ControlsState } = OverviewControls;
+ const {ControlsState} = OverviewControls;
switch (state) {
case ControlsState.HIDDEN:
const adj = this._scrollAdjustment;
const fitMode = this._fitModeAdjustment.value;
- const { initialState, finalState, progress } =
+ const {initialState, finalState, progress} =
this._overviewAdjustment.getStateTransitionParams();
const workspaceMode = (1 - fitMode) * Util.lerp(
}
_getFitModeForState(state) {
- const { ControlsState } = OverviewControls;
+ const {ControlsState} = OverviewControls;
switch (state) {
case ControlsState.HIDDEN:
let fitSingleBox = offsetBox;
let fitAllBox = offsetBox;
- const { transitioning, initialState, finalState } =
+ const {transitioning, initialState, finalState} =
this._overviewAdjustment.getStateTransitionParams();
const isPrimary = Main.layoutManager.primaryIndex === this._monitorIndex;
}
_scrollToActive() {
- const { workspaceManager } = global;
+ const {workspaceManager} = global;
const active = workspaceManager.get_active_workspace_index();
this._animating = true;
this.queue_relayout();
}, this);
- this._settings = new Gio.Settings({ schema_id: MUTTER_SCHEMA });
+ this._settings = new Gio.Settings({schema_id: MUTTER_SCHEMA});
this._settings.connect('changed::workspaces-only-on-primary',
() => this._workspacesOnPrimaryChanged());
this._workspacesOnPrimaryChanged();
}
_getThumbnailParamsForState(state) {
- const { ControlsState } = OverviewControls;
+ const {ControlsState} = OverviewControls;
let opacity, scale;
switch (state) {
break;
}
- return { opacity, scale };
+ return {opacity, scale};
}
_getThumbnailsHeight(box) {
return 0;
const [width, height] = box.get_size();
- const { expandFraction } = this._thumbnails;
+ const {expandFraction} = this._thumbnails;
const [thumbnailsHeight] = this._thumbnails.get_preferred_height(width);
return Math.min(
thumbnailsHeight * expandFraction,
}
_getWorkspacesBoxForState(state, box, padding, thumbnailsHeight, spacing) {
- const { ControlsState } = OverviewControls;
+ const {ControlsState} = OverviewControls;
const workspaceBox = box.copy();
const [width, height] = workspaceBox.get_size();
const themeNode = this.get_theme_node();
const contentBox = themeNode.get_content_box(box);
const [width, height] = contentBox.get_size();
- const { expandFraction } = this._thumbnails;
+ const {expandFraction} = this._thumbnails;
const spacing = themeNode.get_length('spacing') * expandFraction;
const padding =
Math.round((1 - SECONDARY_WORKSPACE_SCALE) * height / 2);
if (!this._thumbnails.visible)
return;
- const { initialState, finalState, progress } =
+ const {initialState, finalState, progress} =
this._overviewAdjustment.getStateTransitionParams();
const initialParams = this._getThumbnailParamsForState(initialState);
Main.layoutManager.overviewGroup,
Clutter.Orientation.HORIZONTAL,
Shell.ActionMode.OVERVIEW,
- { allowDrag: false });
+ {allowDrag: false});
this._swipeTracker.allowLongSwipes = true;
this._swipeTracker.connect('begin', this._switchWorkspaceBegin.bind(this));
this._swipeTracker.connect('update', this._switchWorkspaceUpdate.bind(this));
this._primaryIndex = Main.layoutManager.primaryIndex;
this._workspacesViews = [];
- this._settings = new Gio.Settings({ schema_id: MUTTER_SCHEMA });
+ this._settings = new Gio.Settings({schema_id: MUTTER_SCHEMA});
this._inWindowDrag = false;
this._leavingOverview = false;
}
_updateTrackerOrientation() {
- const { layoutRows } = global.workspace_manager;
+ const {layoutRows} = global.workspace_manager;
this._swipeTracker.orientation = layoutRows !== -1
? Clutter.Orientation.HORIZONTAL
: Clutter.Orientation.VERTICAL;
let progress = adjustment.value / adjustment.page_size;
let points = Array.from(
- { length: workspaceManager.n_workspaces }, (v, i) => i);
+ {length: workspaceManager.n_workspaces}, (v, i) => i);
tracker.confirmSwipe(distance, points, progress, Math.round(progress));
_getMonitorIndexForEvent(event) {
let [x, y] = event.get_coords();
- let rect = new Meta.Rectangle({ x, y, width: 1, height: 1 });
+ let rect = new Meta.Rectangle({x, y, width: 1, height: 1});
return global.display.get_monitor_index_for_rect(rect);
}
}
_onKeyPressEvent(actor, event) {
- const { ControlsState } = OverviewControls;
+ const {ControlsState} = OverviewControls;
if (this._overviewAdjustment.value !== ControlsState.WINDOW_PICKER)
return Clutter.EVENT_PROPAGATE;
if (!this.reactive)
return Clutter.EVENT_PROPAGATE;
- const { workspaceManager } = global;
+ const {workspaceManager} = global;
const vertical = workspaceManager.layout_rows === -1;
const rtl = this.get_text_direction() === Clutter.TextDirection.RTL;
this._cursorWindowClone = null;
// Used as a drag actor in case we don't have a cursor window clone
- this._dummy = new Clutter.Actor({ width: 1, height: 1, opacity: 0 });
+ this._dummy = new Clutter.Actor({width: 1, height: 1, opacity: 0});
Main.uiGroup.add_actor(this._dummy);
this._dummy.hide();
source: cursorWindow,
});
- this._cursorWindowClone = new Clutter.Clone({ source: cursorWindow });
+ this._cursorWindowClone = new Clutter.Clone({source: cursorWindow});
Main.uiGroup.add_actor(this._cursorWindowClone);
// Make sure that the clone has the same position as the source
jsdoc/require-param-description: off
jsdoc/require-param-name: off
jsdoc/require-param-type: off
- object-curly-spacing:
- - error
- - always
class Application extends Adw.Application {
_init() {
GLib.set_prgname('gnome-extensions-app');
- super._init({ application_id: Package.name });
+ super._init({application_id: Package.name});
this.connect('window-removed', (a, window) => window.run_dispose());
}
this._shellProxy = new GnomeShellProxy(Gio.DBus.session,
'org.gnome.Shell.Extensions', '/org/gnome/Shell/Extensions');
- this._window = new ExtensionsWindow({ application: this });
+ this._window = new ExtensionsWindow({application: this});
}
});
this._updatesCheckId = 0;
- this._exporter = new Shew.WindowExporter({ window: this });
+ this._exporter = new Shew.WindowExporter({window: this});
this._exportedHandle = '';
this.add_action_entries(
this._searchTerms = [];
this._searchEntry.connect('search-changed', () => {
- const { text } = this._searchEntry;
+ const {text} = this._searchEntry;
if (text === '')
this._searchTerms = [];
else
}
get hasError() {
- const { state } = this._extension;
+ const {state} = this._extension;
return state === ExtensionState.OUT_OF_DATE ||
state === ExtensionState.ERROR;
}